vue 解决两次访问相同路由地址报错

在main.js中输入

// 解决两次访问相同路由地址报错
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

 

你可能感兴趣的:(vue 解决两次访问相同路由地址报错)