应该是router版本太高的问题
如果是push方法,在router文件里的index.js加入
const VueRouterPush = Router.prototype.push
Router.prototype.push = function push (to) {
return VueRouterPush.call(this, to).catch(err => err)
}
如果是replace方法,在点击方法中加入(自行更改判断条件)
itemClick(){
if(this.$route.path!==this.path)
this.$router.replace(this.path)
}