Avoided redundant navigation to current location: “/xxx“

在使用element框架搭建vue项目中,你可能会遇到这种报错, 对项目功能实现没有什么影响,但他就是有报错
报错的原因是因为路由跳转重复点击造成的,可以在路由配置文件或者main.js里边加上以下代码,就没有报错了

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

猜你喜欢

转载自blog.csdn.net/m0_49159526/article/details/110055216