vue-router.esm.js:2046 Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: “/fristhome/product”.
原因:Uncaught (in promise) navigationduplicate:避免冗余导航到当前位置:“/ frishome /product”。
简单来说,就是路由重复性的加载导致路由沉余
解决方法:找到router/index.js 配置下面
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
const router = new VueRouter({
routes
})