commit
8608ee5385
|
@ -2,6 +2,7 @@
|
||||||
node_modules
|
node_modules
|
||||||
/dist
|
/dist
|
||||||
example.html
|
example.html
|
||||||
|
favicon.ico
|
||||||
# local env files
|
# local env files
|
||||||
.env.local
|
.env.local
|
||||||
.env.*.local
|
.env.*.local
|
||||||
|
|
|
@ -89,6 +89,22 @@
|
||||||
},
|
},
|
||||||
created(){
|
created(){
|
||||||
this.setTags(this.$route);
|
this.setTags(this.$route);
|
||||||
|
// 监听关闭当前页面的标签页
|
||||||
|
bus.$on('close_current_tags', () => {
|
||||||
|
for (let i = 0, len = this.tagsList.length; i < len; i++) {
|
||||||
|
const item = this.tagsList[i];
|
||||||
|
if(item.path === this.$route.fullPath){
|
||||||
|
if(i < len - 1){
|
||||||
|
this.$router.push(this.tagsList[i+1].path);
|
||||||
|
}else if(i > 0){
|
||||||
|
this.$router.push(this.tagsList[i-1].path);
|
||||||
|
}else{
|
||||||
|
this.$router.push('/');
|
||||||
|
}
|
||||||
|
this.tagsList.splice(i, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue