其他分享
首页 > 其他分享> > Avoided redundant navigation to current location: “/“

Avoided redundant navigation to current location: “/“

作者:互联网

这里写自定义目录标题

vue使用element ui 的导航栏的时候会出现报错:Avoided redundant navigation to current location: "/"的解决方法

vue项目报错:Avoided redundant navigation to current location: “/”。使用侧边栏导航栏的时候重复点击会出现这样的报错
在这里插入图片描述

解决方法

打开你router目录下的index.js文件,复制下面代码,添加到最下方就可以了。
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}

标签:redundant,current,报错,location,Avoided,navigation
来源: https://blog.csdn.net/qq1143417367/article/details/114259113