mirror of
https://github.com/IT4Change/boilerplate-frontend.git
synced 2025-12-13 07:35:53 +00:00
16 lines
393 B
TypeScript
16 lines
393 B
TypeScript
import { createApp } from './app'
|
|
|
|
import type { PageContext, VikePageContext } from '#types/PageContext'
|
|
|
|
let instance: ReturnType<typeof createApp>
|
|
/* async */ function render(pageContext: VikePageContext & PageContext) {
|
|
if (!instance) {
|
|
instance = createApp(pageContext)
|
|
instance.app.mount('#app')
|
|
} else {
|
|
instance.app.changePage(pageContext)
|
|
}
|
|
}
|
|
|
|
export default render
|