import Vue from 'vue'
import Router from 'vue-router'

// hack router push callback
const originalPush = Router.prototype.push
Router.prototype.push = function push (location, onResolve, onReject) {
  if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
  return originalPush.call(this, location).catch(err => err)
}
Vue.use(Router)

 

相关文章:

  • 2022-12-23
  • 2021-11-23
  • 2021-06-30
  • 2022-12-23
  • 2022-01-20
  • 2021-03-03
  • 2022-12-23
  • 2021-06-15
猜你喜欢
  • 2023-04-05
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案