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