报错信息:vue-router.esm.js?8c4f:2065 Uncaught (in promise) Error: Redirected when going from “/home/page” to “/home/my” via a 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);
}
来解决重定向的报错
版权声明:本文为qianduankangkang原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。