在VUE中路由遇到Error: Avoided redundant navigation to current location:报错显示是路由重复,
在你引入VueRouter的时候再加上一句话:
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
本文介绍了在Vue项目中遇到'Error: Avoided redundant navigation to current location'错误的解决方法。当出现路由重复导致的报错时,可以通过在引入VueRouter时添加特定配置来避免该问题。
1万+

被折叠的 条评论
为什么被折叠?



