写项目的时候,多次点击同一路由地址的时候,router会报错,错误如下:
网上查了一下,发现是因为router版本bug,需要升级router ,方法如下(亲测有效) :
第一种方法,升级vue-router:
npm i vue-router@3.0 -S
第二种方法,不升级vue-router,修改main.js
// main.js
import Router from 'vue-router'
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
以上,就能解决了
最后
以上就是斯文小刺猬最近收集整理的关于VueNavigationDuplicated报错解决方案的全部内容,更多相关VueNavigationDuplicated报错解决方案内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复