vue3-core/playground/src/main.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
545 B
TypeScript
Raw Normal View History

import { createComponentInstance, render, unmountComponent } from 'vue/vapor'
import { createApp } from 'vue'
2024-02-13 03:19:15 +08:00
import './style.css'
2023-11-17 03:01:19 +08:00
2024-02-15 06:34:03 +08:00
const modules = import.meta.glob<any>('./**/*.(vue|js)')
2023-11-24 20:29:05 +08:00
const mod = (modules['.' + location.pathname] || modules['./App.vue'])()
2024-01-31 17:00:19 +08:00
mod.then(({ default: mod }) => {
if (mod.vapor) {
const instance = createComponentInstance(mod, {})
render(instance, '#app')
// @ts-expect-error
globalThis.unmount = () => {
unmountComponent(instance)
}
} else {
createApp(mod).mount('#app')
2024-01-31 17:00:19 +08:00
}
})