vue router路径重复时报错

参考——  https://blog.csdn.net/zz00008888/article/details/119566375

报错:

Avoided redundant navigation to current location: "/Eee". NavigationDuplicated: Avoided redundant navigation to current location: "/Eee".

 

在router的index下添加

//避免路径重复时报错
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

 

posted @ 2024-09-04 15:50  椰子灰  阅读(98)  评论(0编辑  收藏  举报