beforeRouteEnter (to, from, next) {
    // 在渲染该组件的对应路由被 confirm 前调用
    // 不!能!获取组件实例 `this`
    // 因为当守卫执行前,组件实例还没被创建
  },
beforeRouteEnter 里面的变量不能使用this,即不能使用data函数中定义的变量,可以使用外面定义的变量(非组件内定义的变量)。

相关文章:

  • 2021-09-12
  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2021-06-08
  • 2021-08-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-04
  • 2021-07-09
相关资源
相似解决方案