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()
}
相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息