mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 09:25:54 +00:00
fix(nitro): inject payload for spa renderer (#1434)
This commit is contained in:
parent
ad7e7551ec
commit
c6f769e94d
@ -27,7 +27,10 @@ const getSSRRenderer = cachedResult(async () => {
|
||||
const getSPARenderer = cachedResult(async () => {
|
||||
const clientManifest = await getClientManifest()
|
||||
return (ssrContext) => {
|
||||
ssrContext.nuxt = {}
|
||||
ssrContext.nuxt = {
|
||||
serverRendered: false,
|
||||
config: publicConfig
|
||||
}
|
||||
return {
|
||||
html: '<div id="__nuxt"></div>',
|
||||
renderResourceHints: () => '',
|
||||
|
@ -104,8 +104,8 @@ export function useAsyncData<
|
||||
return nuxt._asyncDataPromises[key]
|
||||
}
|
||||
|
||||
const fetchOnServer = options.server !== false
|
||||
const clientOnly = options.server === false
|
||||
const fetchOnServer = options.server !== false && nuxt.payload.serverRendered
|
||||
const clientOnly = options.server === false || !nuxt.payload.serverRendered
|
||||
|
||||
// Server side
|
||||
if (process.server && fetchOnServer) {
|
||||
|
Loading…
Reference in New Issue
Block a user