Vue中关于重复点击同一个路由出现的报错问题解决

Vue中关于重复点击同一个路由出现的报错问题解决

方案3代码:

// 把这段代码直接粘贴到router/index.js中的Vue.use(VueRouter)之前
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function(location) {
  return originalPush.call(this, location).catch(err => {})
};

猜你喜欢

转载自blog.csdn.net/jolinoy/article/details/127017441