mirror of https://gitee.com/xiaonuobase/snowy
【更新】关闭多标签功能后,移除其他被缓存的标签
parent
89ae5eff78
commit
0dc2d9dcf6
|
@ -60,7 +60,7 @@
|
|||
<script>
|
||||
import tool from '@/utils/tool'
|
||||
import XnContextMenu from '@/components/XnContextMenu/index.vue'
|
||||
import { iframeStore, keepAliveStore, viewTagsStore } from '@/store'
|
||||
import {globalStore, iframeStore, keepAliveStore, viewTagsStore} from '@/store'
|
||||
import { mapState, mapActions } from 'pinia'
|
||||
|
||||
export default {
|
||||
|
@ -79,6 +79,7 @@
|
|||
},
|
||||
computed: {
|
||||
...mapState(viewTagsStore, ['viewTags']),
|
||||
...mapState(globalStore, ['layoutTagsOpen']),
|
||||
tagList() {
|
||||
return this.viewTags
|
||||
}
|
||||
|
@ -86,6 +87,9 @@
|
|||
watch: {
|
||||
$route(to) {
|
||||
this.addViewTags(to)
|
||||
},
|
||||
layoutTagsOpen() {
|
||||
this.closeOtherCacheTabs()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -161,7 +165,6 @@
|
|||
// 增加tag
|
||||
addViewTags(route) {
|
||||
this.activeKey = route.fullPath
|
||||
|
||||
if (route.name && !route.meta.fullpage) {
|
||||
this.pushViewTags(route)
|
||||
this.pushKeepLive(route.name)
|
||||
|
@ -241,6 +244,13 @@
|
|||
}
|
||||
})
|
||||
},
|
||||
// 多标签功能关闭时关闭被缓存的标签
|
||||
closeOtherCacheTabs () {
|
||||
const tags = [...this.tagList]
|
||||
tags.forEach((tag) => {
|
||||
this.closeSelectedTag(tag, false)
|
||||
})
|
||||
},
|
||||
// TAB 最大化(包括标签栏)
|
||||
maximize() {
|
||||
this.contextMenuVisible = false
|
||||
|
|
|
@ -152,9 +152,6 @@
|
|||
},
|
||||
computed: {
|
||||
...mapState(globalStore, ['sysBaseConfig']),
|
||||
// captchaOpen() {
|
||||
// return this.sysBaseConfig.SNOWY_SYS_DEFAULT_CAPTCHA_OPEN === 'true'
|
||||
// }
|
||||
},
|
||||
watch: {
|
||||
'config.theme': function (val) {
|
||||
|
|
Loading…
Reference in New Issue