添加持久化标签页开关功能

This commit is contained in:
RuoYi
2026-03-22 21:03:58 +08:00
parent 0f734eda88
commit ec0ca11cc6
5 changed files with 79 additions and 3 deletions

View File

@@ -65,6 +65,11 @@
<el-switch v-model="tagsView" class="drawer-switch" />
</div>
<div class="drawer-item">
<span>持久化标签页</span>
<el-switch v-model="tagsViewPersist" :disabled="!tagsView" class="drawer-switch" />
</div>
<div class="drawer-item">
<span>显示页签图标</span>
<el-switch v-model="tagsIcon" :disabled="!tagsView" class="drawer-switch" />
@@ -125,6 +130,20 @@ export default {
})
}
},
tagsViewPersist: {
get() {
return this.$store.state.settings.tagsViewPersist
},
set(val) {
this.$store.dispatch('settings/changeSetting', {
key: 'tagsViewPersist',
value: val
})
if (!val) {
this.$cache.local.remove('tags-view-visited')
}
}
},
tagsView: {
get() {
return this.$store.state.settings.tagsView
@@ -237,6 +256,7 @@ export default {
"navType":${this.navType},
"tagsView":${this.tagsView},
"tagsIcon":${this.tagsIcon},
"tagsViewPersist":${this.tagsViewPersist},
"fixedHeader":${this.fixedHeader},
"sidebarLogo":${this.sidebarLogo},
"dynamicTitle":${this.dynamicTitle},