我只想把我的商店导入我的Vuex Route-Gard .
路由器/ AUTH-guard.js
import {store} from '../store'
export default (to, from, next) => {
if (store.getters.user) {
next()
} else {
next('/login')
}
}
存储/ index.js
import {store} from '../store'
export default (to, from, next) => {
if (store.getters.user) {
next()
} else {
next('/login')
}
}
在'../store'中找不到导出'store'的错误
我的vue设置了
"dependencies": {
"firebase": "^4.3.0",
"vue": "^2.3.3",
"vue-router": "^2.6.0",
"vuex": "^2.3.1"
1 回答
我能够解决这个问题 .
main.js
AUTH-后卫
存储/ index.js