fix(projects): fix app loading theme color

This commit is contained in:
Soybean
2024-01-18 02:43:07 +08:00
parent b30c0359f6
commit 0ba19d5479
2 changed files with 9 additions and 6 deletions

View File

@ -126,11 +126,13 @@ export const useThemeStore = defineStore(SetupStoreId.Theme, () => {
{ immediate: true }
);
// themeColors change, update css vars
// themeColors change, update css vars and storage theme color
watch(
themeColors,
() => {
val => {
setupThemeVarsToHtml();
localStg.set('themeColor', val.primary);
},
{ immediate: true }
);