We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 05d6a7b + 4ff06b7 commit 8608ee5Copy full SHA for 8608ee5
.gitignore
@@ -2,6 +2,7 @@
2
node_modules
3
/dist
4
example.html
5
+favicon.ico
6
# local env files
7
.env.local
8
.env.*.local
src/components/common/Tags.vue
@@ -89,6 +89,22 @@
89
},
90
created(){
91
this.setTags(this.$route);
92
+ // 监听关闭当前页面的标签页
93
+ bus.$on('close_current_tags', () => {
94
+ for (let i = 0, len = this.tagsList.length; i < len; i++) {
95
+ const item = this.tagsList[i];
96
+ if(item.path === this.$route.fullPath){
97
+ if(i < len - 1){
98
+ this.$router.push(this.tagsList[i+1].path);
99
+ }else if(i > 0){
100
+ this.$router.push(this.tagsList[i-1].path);
101
+ }else{
102
+ this.$router.push('/');
103
+ }
104
+ this.tagsList.splice(i, 1);
105
106
107
+ })
108
}
109
110
0 commit comments