vue-router报错的解决方法vue-router.esm.js?8c4f:2065 Uncaught (in promise) NavigationDuplicated:

在main.js中加入以下代码
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
 

你可能感兴趣的:(VUE,Vue,Router,异常处理,push方法,错误捕获,前端开发)