在
Vue
中路由报错NavigationDuplicated: 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) }
解决 NavigationDuplicated: Avoided redundant navigation to current location: "/"
最新推荐文章于 2024-04-22 10:01:45 发布