小编Mas*_*eem的帖子

无法读取未定义的属性(读取“$store”)

嗨,我收到此错误无法读取未定义的属性(读取“$store”):这是我的路由器(index.js)

{
  path: '/',
  name: 'login',
  component: () => import( /* webpackChunkName: "hours" */ '../views/login.vue'),
  meta: {
    hideNavbar: true,
  },
  beforeEnter: (to, from, next) => {
    if (this.$store.state.authenticated.admin === true) {
      next('/home');
    } else {
      next(false);
    }
  }
Run Code Online (Sandbox Code Playgroud)

在上面的代码中,我正在努力导航到主页...收到此错误。这里`TypeError:无法读取未定义的属性(读取'$store')

vue.js vue-router vuex

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

vue-router ×1

vue.js ×1

vuex ×1