Quantcast
Channel: Vuex store is undefined in vue-router - Stack Overflow
Browsing latest articles
Browse All 2 View Live

Answer by tony19 for Vuex store is undefined in vue-router

This is indeed caused by the circular reference. You could avoid importing the store in router.js by using router.app, which provides a reference the associated Vue instance the router was injected to....

View Article



Image may be NSFW.
Clik here to view.

Vuex store is undefined in vue-router

I have a router and a global beforeEach hook to validate auth.import store from "@/store/store";const router = new Router({ // routes...});router.beforeEach((to, from, next) => { if...

View Article
Browsing latest articles
Browse All 2 View Live




Latest Images