【更新】解决PR导致菜单配置换成为否时不生效问题

This commit is contained in:
俞宝山
2026-07-02 23:18:37 +08:00
parent 8207358a78
commit 138a2a6516
2 changed files with 9 additions and 6 deletions
@@ -118,7 +118,11 @@
activeKey.value = viewTag ? viewTag.fullPath : to.fullPath
if (to.name && !to.meta.fullpage) {
vStore.pushViewTags(to)
kStore.pushKeepLive(to.name)
if (to.meta.keepLive !== false) {
kStore.pushKeepLive(to.name)
} else {
kStore.removeKeepLive(to.name)
}
}
if (tagList.value.length - 1 > maxTabs.value) {
const firstTag = tagList.value[1]
+4 -5
View File
@@ -53,10 +53,7 @@ export const viewTagsStore = defineStore('viewTags', () => {
// 把当前标签快照写入 sessionStorage
const cacheViewTags = () => {
try {
tool.session.set(
VIEW_TAGS_STORAGE_KEY,
viewTags.value.map(slimRoute)
)
tool.session.set(VIEW_TAGS_STORAGE_KEY, viewTags.value.map(slimRoute))
} catch (e) {
console.warn('viewTags 写入 sessionStorage 失败:', e)
}
@@ -129,7 +126,9 @@ export const viewTagsStore = defineStore('viewTags', () => {
if (!route || !route.name || route.meta?.fullpage) return
if (viewTags.value.find((item) => item.path === route.path)) return
viewTags.value.push(route)
kStore.pushKeepLive(route.name)
if (route.meta?.keepLive !== false) {
kStore.pushKeepLive(route.name)
}
})
}