解决二次点击路由报错问题

解决二次点击路由报错问题

  import VueRouter from 'vue-router'
  const originalPush = VueRouter.prototype.push
  VueRouter.prototype.push = function push(location) {
      return originalPush.call(this, location).catch(err => err)
  } 
posted @ 2021-11-12 20:32  沫小墨  阅读(73)  评论(0)    收藏  举报