NavigationDuplicated: Avoided redundant navigation to current location: “/fristhome/product“.

vue-router.esm.js:2046 Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: “/fristhome/product”.

NavigationDuplicated: Avoided redundant navigation to current location: “/fristhome/product“._第1张图片

原因: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
})

你可能感兴趣的:(报错盒,vue,javascript,开发语言,路由)