Quantcast
Channel: Vue js "store is not defined" in router.js - Stack Overflow
Browsing index pages (3 articles)
↧

Vue js "store is not defined" in router.js

I want to perform a redirect, but before the redirect happens i want to perform a action using store.dispatch. Error is "store is not defined" in the console.I have tried putting the whole line of code...

View Article


Answer by Gander for Vue js "store is not defined" in router.js

You need to install it in the main component. Then you refer to this through this.$store. Read the Vuex documentation.export const store = new Vuex.Store({ state: {}, mutations: {}, getters: {}})import...

View Article


Answer by Alexander for Vue js "store is not defined" in router.js

So it resolved. It was a Chrome bug saying that store is undefined, it's in webpack. Store was defined. The problem was the mismatch between actions and mutations sending payloads that did not match...

View Article
Browsing index pages (3 articles)


Latest Images