Vue plugin for rendering components asynchronously outside main app context with automatic lifecycle management and DOM cleanup.
- Render Vue components asynchronously
- Automatic lifecycle management
- DOM cleanup and memory leak prevention
- Context inheritance from parent app
- Custom wrapper support
pnpm install async-rendererimport { createApp } from "vue";
import asyncRendererPlugin from "async-renderer";
const app = createApp(App);
app.use(asyncRendererPlugin);<script setup>
import { useAsyncRenderer } from "async-renderer";
const asyncRenderer = useAsyncRenderer();
function openDialog() {
asyncRenderer.create(() => import("./Dialog.vue"));
}
</script>Returns an object with:
create(component, props?, options?)- Create new renderer instancegetAllRenderer()- Get all active renderersgetRenderer(id)- Get specific renderer by ID
# Install dependencies
npm install
# Run playground
npm run playground
# Build library
npm run buildMIT