Quantcast
Channel: Vuex store is undefined in vue-router - Stack Overflow
Browsing index pages (2 articles)
↧

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


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

Browsing index pages (2 articles)


Latest Images