投稿提示

This commit is contained in:
2026-01-07 09:17:59 +08:00
parent 539c8b312e
commit 0f3ee631e3
6 changed files with 290 additions and 94 deletions

View File

@@ -0,0 +1,21 @@
<template>
<div></div>
</template>
<script>
export default {
beforeCreate() {
// 获取传递过来的路径和参数
const { path, ...query } = this.$route.query;
// 立即跳回原页面
this.$router.replace({
path: path,
query: query
});
},
// 渲染一个空节点
render(h) {
return h();
}
};
</script>

View File

@@ -65,6 +65,9 @@
if(this.tagsList.length >= 8){
this.tagsList.shift();
}
if(route.meta.hideInTags){
return false;
}
this.tagsList.push({
title: route.meta.title,
path: route.fullPath,
@@ -90,7 +93,9 @@
created(){
this.setTags(this.$route);
// 监听关闭当前页面的标签页
bus.$on('close_current_tags', () => {
console.log('出发关闭当前标签页');
for (let i = 0, len = this.tagsList.length; i < len; i++) {
const item = this.tagsList[i];
if(item.path === this.$route.fullPath){
@@ -106,7 +111,11 @@
}
}
})
}
},
// beforeDestroy() {
// // 销毁监听,防止内存泄漏
// this.$bus.$off('close_current_tags');
// }
}
</script>