Error: Avoided redundant navigation to current location: “/XXX“.的问题
程序员文章站
2022-04-10 09:47:14
Error: Avoided redundant navigation to current location: “/XXX”今天用vue的小demo,当我点击事件时,在浏览器上报如下错我,由于对前对不是很了解,一直找不到错在哪点,进过一番百度一下,终于找到了解决的办法,这个错误时由于路由重复,解决办法:在vue项目下的router的index.js上,在代码里的Vue.use(Router)上加上以下几行代码,大功告成:/** * 解决ElementUI导航栏中的vue-router在3.0版本...
Error: Avoided redundant navigation to current location: “/XXX”
今天用vue的小demo,当我点击事件时,在浏览器上报如下错我,由于对前对不是很了解,一直找不到错在哪点,
进过一番百度一下,终于找到了解决的办法,这个错误时由于路由重复,解决办法:在vue项目下的router的index.js上,在代码里的Vue.use(Router)下面加上以下几行代码,大功告成:
/**
* 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
*/
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
本文地址:https://blog.csdn.net/m0_45025997/article/details/107252926
上一篇: JS上传文件显示进度条
下一篇: JS实现跟随鼠标的提示框
推荐阅读
-
Avoided redundant navigation to current location:
-
Error: Avoided redundant navigation to current location: “/XXX“.的问题
-
vue报错NavigationDuplicated: Avoided redundant navigation to current location: “/“.
-
Avoided redundant navigation to current location的解决方式
-
Error: Avoided redundant navigation to current location: “/XXX“.的问题
-
vue报错NavigationDuplicated: Avoided redundant navigation to current location: “/“.
-
Avoided redundant navigation to current location: