fix: The built-in theme does not take effect, fixed #55 [deploy]

This commit is contained in:
vben
2024-07-29 22:53:04 +08:00
parent cd10eb9471
commit 239f681ea1
4 changed files with 15 additions and 8 deletions

View File

@@ -121,10 +121,11 @@ export const useCoreTabbarStore = defineStore('core-tabbar', {
} else {
// 页面已经存在,不重复添加选项卡,只更新选项卡参数
const currentTab = toRaw(this.tabs)[tabIndex];
if (!currentTab.meta.affixTab) {
const mergedTab = { ...currentTab, ...tab };
this.tabs.splice(tabIndex, 1, mergedTab);
const mergedTab = { ...currentTab, ...tab };
if (Reflect.has(currentTab.meta, 'affixTab')) {
mergedTab.meta.affixTab = currentTab.meta.affixTab;
}
this.tabs.splice(tabIndex, 1, mergedTab);
}
this.updateCacheTab();
},
@@ -359,6 +360,7 @@ export const useCoreTabbarStore = defineStore('core-tabbar', {
*/
async toggleTabPin(tab: TabDefinition) {
const affixTab = tab?.meta?.affixTab ?? false;
await (affixTab ? this.unpinTab(tab) : this.pinTab(tab));
},