fix(tagsView.ts): 固定tag位置置顶在前
Former-commit-id: 30c09d356d4f199b4f5f7587c8eec123ec7f5bb7
This commit is contained in:
@@ -10,11 +10,19 @@ const useTagsViewStore = defineStore({
|
||||
actions: {
|
||||
addVisitedView(view: any) {
|
||||
if (this.visitedViews.some(v => v.path === view.path)) return;
|
||||
this.visitedViews.push(
|
||||
Object.assign({}, view, {
|
||||
title: view.meta?.title || 'no-name'
|
||||
})
|
||||
);
|
||||
if (view.meta && view.meta.affix) {
|
||||
this.visitedViews.unshift(
|
||||
Object.assign({}, view, {
|
||||
title: view.meta?.title || 'no-name'
|
||||
})
|
||||
);
|
||||
} else {
|
||||
this.visitedViews.push(
|
||||
Object.assign({}, view, {
|
||||
title: view.meta?.title || 'no-name'
|
||||
})
|
||||
);
|
||||
}
|
||||
},
|
||||
addCachedView(view: any) {
|
||||
if (this.cachedViews.includes(view.name)) return;
|
||||
|
||||
Reference in New Issue
Block a user