update src/store/modules/tagsView.ts.

不是很懂这个文件在做什么,但是用更简单的方式为Set删除元素

Signed-off-by: supemeko <nek03@qq.com>
pull/460/head
supemeko 2024-06-14 20:15:04 +00:00 committed by Gitee
parent 93bee8c82c
commit 10bba2de31
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 4 deletions

View File

@ -72,10 +72,7 @@ export const useTagsViewStore = defineStore('tagsView', {
// 删除缓存
delCachedView() {
const route = router.currentRoute.value
const index = findIndex<string>(this.getCachedViews, (v) => v === route.name)
if (index > -1) {
this.cachedViews.delete(this.getCachedViews[index])
}
this.cachedViews.delete(route.name)
},
// 删除所有缓存和tag
delAllViews() {