点击同一个路由的时候就会报这个错,解决办法本人亲测有效两种:

 

第一种

 

this.$router.push('/home',onAbort => { })
通过加回调函数规避
但是路由多的时候显然是太麻烦。
 
第二种
 
 
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
 return originalPush.call(this, location).catch(err => err)
 }
 
写到route.js里面就好了

相关文章:

  • 2022-01-11
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
  • 2021-07-07
  • 2021-09-24
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
  • 2021-09-23
  • 2021-08-11
相关资源
相似解决方案