vue-router.esm.js?ccee:1905

vue-router.esm.js?ccee:1905 <failed to convert exception to string> 解决: next('/')会死循环。 应该:vue

router.beforeEach((to, from, next) => {
  // 若是定义了beforeEach,没有next,访问将空白。
  if (to.path !== '/') {
    return next('/')
  }
  next()
}
相关文章
相关标签/搜索
本站公众号
   欢迎关注本站公众号,获取更多信息