update
This commit is contained in:
1 parent
2396bbcf12
commit
baa5bc091e
14 files changed
+275
-269
No files matched your search
@@ -1,9 +1,10 @@
|
||||
import { renderToString } from '@vue/server-renderer'
|
||||
import { escapeInject, dangerouslySkipEscape } from 'vite-plugin-ssr'
|
||||
import { dangerouslySkipEscape, escapeInject } from 'vite-plugin-ssr'
|
||||
import type { PageContextBuiltIn } from 'vite-plugin-ssr'
|
||||
|
||||
import { createApp } from './app'
|
||||
import logoUrl from './logo.svg'
|
||||
import type { PageContext } from './types'
|
||||
import type { PageContextBuiltIn } from 'vite-plugin-ssr'
|
||||
|
||||
export { render }
|
||||
// See https://vite-plugin-ssr.com/data-fetching
|
||||
@@ -14,9 +15,14 @@ async function render(pageContext: PageContextBuiltIn & PageContext) {
|
||||
const appHtml = await renderToString(app)
|
||||
|
||||
// See https://vite-plugin-ssr.com/head
|
||||
const { documentProps } = pageContext
|
||||
const title = (documentProps && documentProps.title) || 'Vite SSR app'
|
||||
const desc = (documentProps && documentProps.description) || 'App using Vite + vite-plugin-ssr'
|
||||
const { documentProps = {} } = pageContext.pageExports as {
|
||||
documentProps: {
|
||||
title?: string
|
||||
description?: string
|
||||
}
|
||||
}
|
||||
const title = (documentProps.title) || 'Vite SSR app'
|
||||
const desc = (documentProps.description) || 'App using Vite + vite-plugin-ssr'
|
||||
|
||||
const documentHtml = escapeInject`<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
Reference in new issue
Block a user