Avoided redundant navigation to current location: "/users"

问题产生的原因:在Vue导航菜单中,重复点击一个菜单,即重复触发一个相同的路由,会报错,但不影响功能

 

解决:在router的配置文件中加入如下代码:


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

 

posted @ 2020-11-21 18:25  司徒二条  阅读(371)  评论(0编辑  收藏  举报