From 239f681ea1de9d707911bb2e65ae45a6405b5963 Mon Sep 17 00:00:00 2001 From: vben Date: Mon, 29 Jul 2024 22:53:04 +0800 Subject: [PATCH] fix: The built-in theme does not take effect, fixed #55 [deploy] --- internal/lint-configs/lint-staged-config/src/index.ts | 8 ++++++-- packages/@core/ui-kit/menu-ui/src/components/menu.vue | 6 +++--- packages/effects/layouts/src/basic/tabbar/use-tabbar.ts | 1 + packages/stores/src/modules/tabbar.ts | 8 +++++--- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/internal/lint-configs/lint-staged-config/src/index.ts b/internal/lint-configs/lint-staged-config/src/index.ts index 9efe7d3b..e68d8a3e 100644 --- a/internal/lint-configs/lint-staged-config/src/index.ts +++ b/internal/lint-configs/lint-staged-config/src/index.ts @@ -5,10 +5,14 @@ export default { ], '*.{scss,less,styl,html,vue,css}': [ 'prettier --cache --ignore-unknown --write', - 'stylelint --fix', + 'stylelint --fix --allow-empty-input', ], '*.md': ['prettier --cache --ignore-unknown --write'], - '*.vue': ['prettier --write', 'eslint --cache --fix', 'stylelint --fix'], + '*.vue': [ + 'prettier --write', + 'eslint --cache --fix', + 'stylelint --fix --allow-empty-input', + ], '{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': [ 'prettier --cache --write--parser json', ], diff --git a/packages/@core/ui-kit/menu-ui/src/components/menu.vue b/packages/@core/ui-kit/menu-ui/src/components/menu.vue index 242a2f91..32dae1ea 100644 --- a/packages/@core/ui-kit/menu-ui/src/components/menu.vue +++ b/packages/@core/ui-kit/menu-ui/src/components/menu.vue @@ -443,10 +443,10 @@ $namespace: vben; // --menu-submenu-opened-background-color: hsl(var(--menu-opened-dark)); --menu-item-background-color: var(--menu-background-color); --menu-item-color: hsl(var(--foreground) / 80%); - --menu-item-hover-color: hsl(var(--primary-foreground)); + --menu-item-hover-color: hsl(var(--accent-foreground)); --menu-item-hover-background-color: hsl(var(--accent)); - --menu-item-active-color: hsl(var(--foreground)); - --menu-item-active-background-color: hsl(var(--accent)); + --menu-item-active-color: hsl(var(--primary-foreground)); + --menu-item-active-background-color: hsl(var(--primary)); --menu-submenu-hover-color: hsl(var(--foreground)); --menu-submenu-hover-background-color: hsl(var(--accent)); --menu-submenu-active-color: hsl(var(--foreground)); diff --git a/packages/effects/layouts/src/basic/tabbar/use-tabbar.ts b/packages/effects/layouts/src/basic/tabbar/use-tabbar.ts index eea9100d..f8a947a5 100644 --- a/packages/effects/layouts/src/basic/tabbar/use-tabbar.ts +++ b/packages/effects/layouts/src/basic/tabbar/use-tabbar.ts @@ -49,6 +49,7 @@ export function useTabbar() { refreshTab, toggleTabPin, } = useTabs(); + const currentActive = computed(() => { return route.fullPath; }); diff --git a/packages/stores/src/modules/tabbar.ts b/packages/stores/src/modules/tabbar.ts index 61141f1c..d67ecac2 100644 --- a/packages/stores/src/modules/tabbar.ts +++ b/packages/stores/src/modules/tabbar.ts @@ -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)); },