Commit adbf793e by 螃蟹 Committed by GitHub

fix(@vben/web-ele): the main color tone for switching between dark and light the…

…mes has been reset (#6678)
1 parent cf6c4c9a
...@@ -104,7 +104,7 @@ function selectColor() { ...@@ -104,7 +104,7 @@ function selectColor() {
watch( watch(
() => [modelValue.value, props.isDark] as [BuiltinThemeType, boolean], () => [modelValue.value, props.isDark] as [BuiltinThemeType, boolean],
([themeType, isDark]) => { ([themeType, isDark], [_, isDarkPrev]) => {
const theme = builtinThemePresets.value.find( const theme = builtinThemePresets.value.find(
(item) => item.type === themeType, (item) => item.type === themeType,
); );
...@@ -113,7 +113,9 @@ watch( ...@@ -113,7 +113,9 @@ watch(
? theme.darkPrimaryColor || theme.primaryColor ? theme.darkPrimaryColor || theme.primaryColor
: theme.primaryColor; : theme.primaryColor;
themeColorPrimary.value = primaryColor || theme.color; if (!(theme.type === 'custom' && isDark !== isDarkPrev)) {
themeColorPrimary.value = primaryColor || theme.color;
}
} }
}, },
); );
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!