fix(projects): 设置tab标题导致meta属性丢失

This commit is contained in:
燕博文 2022-06-14 16:09:33 +08:00
parent 487213b648
commit efcfa576d5

View File

@ -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';
@ -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;
}
},
/**