首页 > 其他 > 详细

关于VUE项目中报Error: Avoided redundant navigation to current location: 的错

时间:2020-06-23 11:39:29      阅读:576      评论:0      收藏:0      [点我收藏+]

在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)
}

这样就可以解决此报错。
可参考:https://blog.csdn.net/xiecheng1995/article/details/106497172/
https://www.cnblogs.com/xinheng/p/13019818.html

关于VUE项目中报Error: Avoided redundant navigation to current location: 的错

原文:https://www.cnblogs.com/yangsg/p/13181030.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!