vue-router.esm.js?8c4f:2008 Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: "/index". 报错原因

 

 在路由文件中加上以下代码

// const originalReplace = VueRouter.prototype.replace;

// VueRouter.prototype.replace = function push(location) {
//   return originalReplace.call(this, location).catch(err => err);
// };

      push ....等雷同替换即可

 

  

posted @ 2022-05-09 14:59  小魏code  阅读(480)  评论(1编辑  收藏  举报