解决方法(全局设置)

// /router/index.js中设置

const originReplace = Router.prototype.replace
const originalPush = Router.prototype.push

Router.prototype.replace = function replace (location) {
  return originReplace.call(this, location).catch(err => err)
}
Router.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}

 

posted on 2022-04-27 14:43  蓝蓝蓝蓝HZ  阅读(235)  评论(0编辑  收藏  举报