在用vue开发项目时,在路由点击时:NavigationDuplicated: Avoided redundant navigation to current location: “/”的问题。
先来看报错截图:

导致这样问题是连续点击相同路由导致报错(不影响正常操作行为)
解决方法
在router的index.js中增加如下代码:
const originalPush = Router.prototype.push;
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}










![MBTI 16型人格职业性格测试源码PC+H5自适应完整版基于ThinkPHP框架[亲测可用]](https://www.icbot.net/upload/portal/20250429/32ccad646f32a5f4926b3b7b5ef3232a.png)












