路由重复 报错解决办法

在VUE中路由遇到Error: Avoided redundant navigation to current location:报错显示是路由重复,

在你引入router.js再加上一句话:

//路由重复 报错解决办法
const originalPush = VueRouter.prototype.push
	VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch((err) => err)
}
原文地址:https://www.cnblogs.com/maizilili/p/13293488.html