mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25:12 +00:00
Add context.serverStoreState
This commit is contained in:
parent
e2a18d76da
commit
7da8785d72
@ -108,6 +108,11 @@ 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__ && window.__NUXT__.state) {
|
||||||
|
ctx.serverStoreState = window.__NUXT__.state
|
||||||
|
}
|
||||||
|
<% } %>
|
||||||
return ctx
|
return ctx
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user