vue项目中,重复点击路由会出现如下报错
解决办法:
在router的配置文件中(router -> index.js)加上:
const originalPush = Router.prototype.push
Router.prototype.push = function push (location) {
return originalPush.call(this, location).catch(err => err)
}
即可解决
参考:
https://blog.csdn.net/xiecheng1995/article/details/106497172/?utm_medium=distribute.pc_relevant.none-task-blog-baidujs-1