在添加如下步骤后报错,但是不影响使用:
activated(){
this.$router.push(this.path);
},
解决办法:
在src目录下面的router文件夹下的index.js中加入如下代码,错误消失
import Vue from 'vue'
import VueRouter from 'vue-router'
const originalReplace = VueRouter.prototype.replace;
VueRouter.prototype.replace = function replace(location) {
return originalReplace.call(this, location).catch(err => err);
};