Skip to content

Commit

Permalink
fix(projects): 设置tab标题导致meta属性丢失
Browse files Browse the repository at this point in the history
  • Loading branch information
yanbowe committed Jun 14, 2022
1 parent 487213b commit efcfa57
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/store/modules/tab/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { unref } from 'vue';
import type { Ref } from 'vue';
import type { Router, RouteLocationNormalizedLoaded } from 'vue-router';
import { defineStore } from 'pinia';
import { useRouterPush } from '@/composables';
Expand Down Expand Up @@ -56,10 +54,10 @@ export const useTabStore = defineStore('tab-store', {
* 设置当前路由对应的页签title
* @param title - tab名称
*/
setActiveTabTitle(title: string | Ref<string>) {
setActiveTabTitle(title: string) {
const item = this.tabs.find(tab => tab.fullPath === this.activeTab);
if (item) {
Object.assign(item, { meta: { title: unref(title) } });
item.meta.title = title;
}
},
/**
Expand Down

0 comments on commit efcfa57

Please sign in to comment.