vue-router在3.0版本以上重复点击菜单报错的问题

 报错样本:

vue-router在3.0版本以上重复点击菜单报错的问题_第1张图片

// Push版本
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

//Replace版本
const originalReplace = VueRouter.prototype.replace;
VueRouter.prototype.replace = function replace(location) {
  return originalReplace.call(this, location).catch(err => err);
}

 

你可能感兴趣的:(Vue)