mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-17 06:01:34 +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) {
|
if (ctx.isServer && context.beforeRenderFns) {
|
||||||
ctx.beforeNuxtRender = (fn) => context.beforeRenderFns.push(fn)
|
ctx.beforeNuxtRender = (fn) => context.beforeRenderFns.push(fn)
|
||||||
}
|
}
|
||||||
<% if (store) { %>
|
if (ctx.isClient && window.__NUXT__) {
|
||||||
if (ctx.isClient && window.__NUXT__ && window.__NUXT__.state) {
|
ctx.serverState = window.__NUXT__
|
||||||
ctx.serverStoreState = window.__NUXT__.state
|
<% if (store) { %>
|
||||||
|
ctx.serverStoreState = ctx.serverState.state
|
||||||
|
<% } %>
|
||||||
}
|
}
|
||||||
<% } %>
|
|
||||||
return ctx
|
return ctx
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user