Extra contents beyond WaniKani
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

30 lines
678 B

import { createSSRApp, defineComponent, h } from 'vue'
import PageShell from './PageShell.vue'
import { setPageContext } from './usePageContext'
import type { PageContext } from './types'
export { createApp }
function createApp(pageContext: PageContext) {
const { Page, pageProps } = pageContext
const PageWithLayout = defineComponent({
render() {
return h(
PageShell,
{},
{
default() {
return h(Page, pageProps || {})
},
},
)
},
})
const app = createSSRApp(PageWithLayout)
// Make `pageContext` available from any Vue component
setPageContext(app, pageContext)
return app
}