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`.
|
||||
const app = {
|
||||
router,
|
||||
<% if (store) { %> store,<% } %>
|
||||
<% if (store) { %>store,<% } %>
|
||||
_nuxt: {
|
||||
defaultTransition,
|
||||
transitions: [ defaultTransition ],
|
||||
@ -86,10 +86,10 @@ async function createApp (ssrContext) {
|
||||
},
|
||||
...App
|
||||
}
|
||||
|
||||
<% if (store) { %>
|
||||
// Make app available in store
|
||||
store.app = app
|
||||
|
||||
<% } %>
|
||||
const next = ssrContext ? ssrContext.next : location => app.router.push(location)
|
||||
let route
|
||||
if (ssrContext) {
|
||||
|
Loading…
Reference in New Issue
Block a user