vue 路由跳转报错
vue-router.esm.js?fe87:1958 Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location:
//vue项目路由跳转报错,连续点击第二次点击菜单跳转时报错//
在main.js中写入如下代码可解决
import VueRouter from “vue-router”
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
//vue项目路由跳转报错,连续点击第二次点击菜单跳转时报错//