UNPKG

vitepress-theme-base-teek

Version:

查看 [使用说明](https://vp.xiaoying.org.cn/pages/9d746f)

12 lines (10 loc) 410 B
import { createApp } from 'vue'; import Overlay from './Overlay.vue'; export const createOverlay = (onClick: () => void): HTMLElement => { const container = document.createElement('div'); const app = createApp(Overlay, { onClick }); app.mount(container); const el = container.firstElementChild; if (!el) throw new Error("Overlay mount failed"); return el as HTMLElement; };