Vue 路由跳转报错 Error: Avoided redundant navigation to current location: "/XXX".

在router文件夹下的index.js中加入下列代码即可解决

const originalPush = VueRouter.prototype.push

VueRouter.prototype.push = function push(location) {

    return originalPush.call(this, location).catch(err => err)

}

你可能感兴趣的:(Vue 路由跳转报错 Error: Avoided redundant navigation to current location: "/XXX".)