mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
Move store hydration after plugins execution
This commit is contained in:
parent
b931dd40ce
commit
8dca358216
@ -47,15 +47,6 @@ async function createApp (ssrContext) {
|
||||
})
|
||||
}
|
||||
|
||||
<% if (store) { %>
|
||||
if (process.browser) {
|
||||
// Replace store state before calling plugins
|
||||
if (window.__NUXT__ && window.__NUXT__.state) {
|
||||
store.replaceState(window.__NUXT__.state)
|
||||
}
|
||||
}
|
||||
<% } %>
|
||||
|
||||
// Create Root instance
|
||||
// here we inject the router and store to all child components,
|
||||
// making them available everywhere as `this.$router` and `this.$store`.
|
||||
@ -123,6 +114,15 @@ async function createApp (ssrContext) {
|
||||
if (typeof <%= plugin.name %> === 'function') await <%= plugin.name %>(ctx)<% }) %>
|
||||
}<% } %>
|
||||
|
||||
<% if (store) { %>
|
||||
if (process.browser) {
|
||||
// Replace store state before calling plugins
|
||||
if (window.__NUXT__ && window.__NUXT__.state) {
|
||||
store.replaceState(window.__NUXT__.state)
|
||||
}
|
||||
}
|
||||
<% } %>
|
||||
|
||||
return {
|
||||
app,
|
||||
router,
|
||||
|
Loading…
Reference in New Issue
Block a user