watch: {
$route(newVal, oldVal){
console.log(newVal.path)
this.setTags(newVal);
}
},
closeTags(index) {
const delItem = this.tagsList.splice(index, 1)[0];
const item = this.tagsList[index] ? this.tagsList[index] : this.tagsList[index - 1];
if (item) {
console.log(item.path)
delItem.path === this.$route.fullPath && this.$router.push(item.path);
}else{
this.$router.push('/main');
}
}
console结果可以贴一下么,而且用store传路由路径是什么操作