Solve the problem of error reporting when repeatedly clicking the same route in Vue

Solve the problem of error reporting when repeatedly clicking the same route in Vue

Option 3 code:

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

 

 

Supongo que te gusta

Origin blog.csdn.net/jolinoy/article/details/127017441
Recomendado
Clasificación