#3 Redirected when go from "/xx" to "/xxx" via navigation guard

image

Redirected when going from "/login?redirect=%2Fdashboard" to "/dashboard" via a navigation guard.
方案1 可行
模块组合成router/index.ts的情况下,在子模块中export default playerRoutes是否存在

方案2 没试(route.js)
// 解决Vue-Router升级导致的Uncaught(in promise) navigation guard问题

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location, onResolve, onReject) {
  if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
  return originalPush.call(this, location).catch(err => err)
}
阅读 1.6k
推荐问题
logo
101 新手上路
子站问答
访问
宣传栏