原因分析:NavigationDuplicated错误就是重复跳转同一个导航,如果每次点击的是不同的路径就不会报错,如果
你已经在本页面了,还点击本页面的导航,就会出现这个错误。
解决办法:在路由设置页面(我是在src下router四文件夹里的index.js设置的)添加如下代码:
// 新增以下代码,解决NavigationDuplicated问题
const originalPush =VueRouter.prototype.push;
VueRouter.prototype,push = function push(location){
return originalPush,call(this, location).catch(err => err)
};