vue-router跳转相同路径报错

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)

 

posted @ 2019-11-27 08:18  _Iniesta  阅读(1438)  评论(0编辑  收藏  举报