Vue路由bug-NavigationDuplicated: Avoided redundant navigation to current location: “/home/news“.
在写路由时添加了如下代码,报错,但是并不影响结果
activated(){
this.$router.push(this.path);
},
解决办法:
在router/index.js中加入如下代码
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catc
原创
2021-05-04 13:01:08 ·
197 阅读 ·
0 评论