解决vue项目中出现NavigationDulicated,navigating to current location(xxxx) is not allowed的问题

这个就是路由问题, 在路由中添加的相同的路由,我们只需要重写路由就行了

可以在router文件或者main.js文件里面引入vue-router,添加以下代码即可

import Routers from "vue-router";


const routerPush = Routers.prototype.push
Routers.prototype.push = function push(location) {
	return routerPush.call(this, location).catch(error => error)
}

猜你喜欢

转载自blog.csdn.net/miao_yf/article/details/106756312