vue路由解决Uncaught (in promise) Error: Avoided redundant navigation to current location: “/home/news“.
在添加如下步骤后报错,但是不影响使用:activated(){this.$router.push(this.path);},解决办法:在router文件夹下的index.js中加入如下代码,错误消失import Vue from 'vue'import VueRouter from 'vue-router'//import HelloWorld from '@/components/HelloWo
·
在添加如下步骤后报错,但是不影响使用:
activated(){
this.$router.push(this.path);
},
解决办法:
在router文件夹下的index.js中加入如下代码,错误消失
import Vue from 'vue'
import VueRouter from 'vue-router'
//import HelloWorld from '@/components/HelloWorld'
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
更多推荐
已为社区贡献13条内容
所有评论(0)