vue-router使用beforeEach鉤子獲取vuex里的state值,初始頁面報(bào)錯(cuò),如何解決?router.beforeEach((to, from, next) => { console.log(router.app.$store.state.isLogin) if(!userinfo && to.path.indexOf('login') == -1){ return next('/login') }else{ return next() }});
vue-router使用beforeEach鉤子獲取vuex里的state值,如何解決?
繁星點(diǎn)點(diǎn)滴滴
2018-08-29 17:10:24