perf: 完善useTagsView

This commit is contained in:
kailong321200875
2023-08-13 16:41:47 +08:00
parent 175abd0aa3
commit e0c55f40d4
4 changed files with 18 additions and 12 deletions

View File

@@ -141,9 +141,9 @@ export const useTagsViewStore = defineStore('tagsView', {
setSelectedTag(tag: RouteLocationNormalizedLoaded) {
this.selectedTag = tag
},
setTitle(title: string) {
setTitle(title: string, path?: string) {
for (const v of this.visitedViews) {
if (v.path === this.selectedTag?.path) {
if (v.path === (path ?? this.selectedTag?.path)) {
v.meta.title = title
break
}