Add context.serverStoreState

This commit is contained in:
Sebastien Chopin 2017-08-31 14:46:06 +02:00
parent e2a18d76da
commit 7da8785d72
1 changed files with 5 additions and 0 deletions

View File

@ -108,6 +108,11 @@ export function getContext (context, app) {
if (ctx.isServer && context.beforeRenderFns) {
ctx.beforeNuxtRender = (fn) => context.beforeRenderFns.push(fn)
}
<% if (store) { %>
if (ctx.isClient && window.__NUXT__ && window.__NUXT__.state) {
ctx.serverStoreState = window.__NUXT__.state
}
<% } %>
return ctx
}