|
|
@ -132,19 +132,22 @@ const useTagsViewStore = defineStore(
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
delLeftTags(view) {
|
|
|
|
delLeftTags(view) {
|
|
|
|
const index = this.visitedViews.findIndex(v => v.path === view.path)
|
|
|
|
return new Promise(resolve => {
|
|
|
|
if (index === -1) {
|
|
|
|
const index = this.visitedViews.findIndex(v => v.path === view.path)
|
|
|
|
return
|
|
|
|
if (index === -1) {
|
|
|
|
}
|
|
|
|
return
|
|
|
|
this.visitedViews = this.visitedViews.filter((item, idx) => {
|
|
|
|
|
|
|
|
if (idx >= index || (item.meta && item.meta.affix)) {
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const i = this.cachedViews.indexOf(item.name)
|
|
|
|
|
|
|
|
if (i > -1) {
|
|
|
|
|
|
|
|
this.cachedViews.splice(i, 1)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
this.visitedViews = this.visitedViews.filter((item, idx) => {
|
|
|
|
|
|
|
|
if (idx >= index || (item.meta && item.meta.affix)) {
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const i = this.cachedViews.indexOf(item.name)
|
|
|
|
|
|
|
|
if (i > -1) {
|
|
|
|
|
|
|
|
this.cachedViews.splice(i, 1)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
resolve([...this.visitedViews])
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|