14、vue router连续点击多次路由报错解决方法

在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)
}

你可能感兴趣的:(14、vue router连续点击多次路由报错解决方法)