vue router 报错: Uncaught (in promise) NavigationDuplicated {_name:""NavigationDuplicated"... 的解决方法

时间:2020-02-22 09:15:13   收藏:0   阅读:473

今天在写vue-music的时候,发现每次跳转路由都会出现这个错误,于是上网查了一下解决的方法

在main.js中添加

import Router from ‘vue-router‘
 
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

原文:https://www.cnblogs.com/guozhiqiang/p/12343987.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!