Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: "/cart报错
解决办法:在router下index.js中加入下面代码
1. replace
const originalReplace = VueRouter.prototype.replace;
VueRouter.prototype.replace = function replace(location) {
return originalReplace.call(this, location).catch(err => err);
};
2. push
const VueRouterPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push (to) {
return VueRouterPush.call(this, to).catch(err => err);
}