UNPKG

@daysnap/horn-ui

Version:

hron ui

16 lines (13 loc) 356 B
import { createApp, type Component } from 'vue' export function mountComponent(RootComponent: Component) { const app = createApp(RootComponent) const root = document.createElement('div') document.body.appendChild(root) return { instance: app.mount(root), unmount() { app.unmount() document.body.removeChild(root) }, } }