vue路由跳转错误:Error: Redirected when going from “/login“ to “/home“ via a navigation guard.
vue路由跳转错误:Error: Redirected when going from “/login” to “/home” via a navigation guard.
·
# 问题描述:
vue路由跳转错误:Error: Redirected when going from “/login” to “/home” via a navigation guard.
错误提示:如图
解决方案:
解决方案一:手动将vue路由版本降至3.0.7,
解决方案二:将以下代码粘贴至 路由注册之前
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条内容
所有评论(0)