mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
19 lines
422 B
TypeScript
19 lines
422 B
TypeScript
import { PageContext } from 'vike/types'
|
|
|
|
import { createApp } from './app'
|
|
import { getTitle } from './utils'
|
|
|
|
let instance: ReturnType<typeof createApp>
|
|
/* async */ function render(pageContext: PageContext) {
|
|
if (!instance) {
|
|
instance = createApp(pageContext)
|
|
instance.app.mount('#app')
|
|
} else {
|
|
instance.app.changePage(pageContext)
|
|
}
|
|
|
|
document.title = getTitle(pageContext)
|
|
}
|
|
|
|
export default render
|