test vite ssr
This commit is contained in:
1 parent
6725bf89ad
commit
066f94188a
20 files changed
+406
No files matched your search
@@ -0,0 +1,30 @@
|
||||
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
|
||||
}
|
||||
Reference in new issue
Block a user