Skip to content

Commit

Permalink
fix(projects): fix customize info color
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Nov 14, 2023
1 parent ab60edc commit f0f0236
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/layouts/modules/theme-drawer/modules/theme-color.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ const themeStore = useThemeStore();
function handleUpdateColor(color: string, key: App.Theme.ThemeColorKey) {
themeStore.updateThemeColors(key, color);
}
function handleUpdateCustomizeInfoColor(checked: boolean) {
themeStore.updateIsCustomizeInfoColor(!checked);
}
</script>

<template>
<ADivider>{{ $t('theme.themeColor.title') }}</ADivider>
<div class="flex-vertical-stretch gap-12px">
<SettingItem v-for="(_, key) in themeStore.themeColors" :key="key" :label="$t(`theme.themeColor.${key}`)">
<template v-if="key === 'info'" #suffix>
<ACheckbox v-model:checked="themeStore.isCustomizeInfoColor">
<ACheckbox :checked="!themeStore.isCustomizeInfoColor" @update:checked="handleUpdateCustomizeInfoColor">
{{ $t('theme.themeColor.followPrimary') }}
</ACheckbox>
</template>
Expand Down
11 changes: 10 additions & 1 deletion src/store/modules/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ export const useThemeStore = defineStore(SetupStoreId.Theme, () => {
}
}

/**
* update is customize info color
* @param customize
*/
function updateIsCustomizeInfoColor(customize: boolean) {
settings.value.isCustomizeInfoColor = customize;
}

/**
* setup theme vars to html
*/
Expand Down Expand Up @@ -134,6 +142,7 @@ export const useThemeStore = defineStore(SetupStoreId.Theme, () => {
antdTheme,
setThemeLayout,
themeColors,
updateThemeColors
updateThemeColors,
updateIsCustomizeInfoColor
};
});

0 comments on commit f0f0236

Please sign in to comment.