perf: 完善useTagsView

This commit is contained in:
kailong321200875
2023-08-13 14:25:49 +08:00
parent a869a457e6
commit 175abd0aa3
5 changed files with 28 additions and 4 deletions

View File

@@ -140,6 +140,14 @@ export const useTagsViewStore = defineStore('tagsView', {
// 设置当前选中的tag
setSelectedTag(tag: RouteLocationNormalizedLoaded) {
this.selectedTag = tag
},
setTitle(title: string) {
for (const v of this.visitedViews) {
if (v.path === this.selectedTag?.path) {
v.meta.title = title
break
}
}
}
}
})