mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
Add serverState
This commit is contained in:
parent
7da8785d72
commit
f4c68e95e2
@ -108,11 +108,12 @@ export function getContext (context, app) {
|
||||
if (ctx.isServer && context.beforeRenderFns) {
|
||||
ctx.beforeNuxtRender = (fn) => context.beforeRenderFns.push(fn)
|
||||
}
|
||||
if (ctx.isClient && window.__NUXT__) {
|
||||
ctx.serverState = window.__NUXT__
|
||||
<% if (store) { %>
|
||||
if (ctx.isClient && window.__NUXT__ && window.__NUXT__.state) {
|
||||
ctx.serverStoreState = window.__NUXT__.state
|
||||
}
|
||||
ctx.serverStoreState = ctx.serverState.state
|
||||
<% } %>
|
||||
}
|
||||
return ctx
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user