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)
}
const originalReplace = VueRouter.prototype.place;
VueRouter.prototype.place = function place(location) {
return originalReplace.call(this, location).catch(err => err)
}
即可解决!