Avoided redundant navigation to current location: "/users"

2023-02-12,,,,

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

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


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

Avoided redundant navigation to current location: "/users"的相关教程结束。

《Avoided redundant navigation to current location: "/users".doc》

下载本文的Word格式文档,以方便收藏与打印。