mirror of
https://gitee.com/xiaonuobase/snowy.git
synced 2026-10-06 06:52:58 +08:00
【更新】解决PR导致菜单配置换成为否时不生效问题
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user