切换路由后,重复点击同一路由,控制台会一直报错,虽然不影响使用,但是看着就是不舒服!
路由js中插入以下代码
import VueRouterfrom 'vue-router'; const originalPush = VueRouter.prototype.push; VueRouter.prototype.push = function push(location) { return originalPush.call(this, location).catch(err => err) }
发表评论