Add serverState

This commit is contained in:
Sebastien Chopin 2017-09-01 10:29:06 +02:00
parent 7da8785d72
commit f4c68e95e2

View File

@ -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
}