mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
Add app in store only if store exists
This commit is contained in:
parent
b00592f157
commit
8dd1bfe169
@ -50,7 +50,7 @@ async function createApp (ssrContext) {
|
|||||||
// making them available everywhere as `this.$router` and `this.$store`.
|
// making them available everywhere as `this.$router` and `this.$store`.
|
||||||
const app = {
|
const app = {
|
||||||
router,
|
router,
|
||||||
<% if (store) { %> store,<% } %>
|
<% if (store) { %>store,<% } %>
|
||||||
_nuxt: {
|
_nuxt: {
|
||||||
defaultTransition,
|
defaultTransition,
|
||||||
transitions: [ defaultTransition ],
|
transitions: [ defaultTransition ],
|
||||||
@ -86,10 +86,10 @@ async function createApp (ssrContext) {
|
|||||||
},
|
},
|
||||||
...App
|
...App
|
||||||
}
|
}
|
||||||
|
<% if (store) { %>
|
||||||
// Make app available in store
|
// Make app available in store
|
||||||
store.app = app
|
store.app = app
|
||||||
|
<% } %>
|
||||||
const next = ssrContext ? ssrContext.next : location => app.router.push(location)
|
const next = ssrContext ? ssrContext.next : location => app.router.push(location)
|
||||||
let route
|
let route
|
||||||
if (ssrContext) {
|
if (ssrContext) {
|
||||||
|
Loading…
Reference in New Issue
Block a user