mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-16 04:02:15 +01:00
fix light/dark theme not currectly initializing on shared report, unify logic
This commit is contained in:
@@ -22,4 +22,12 @@ const theme = computed(() => {
|
||||
return themeSetting.value
|
||||
});
|
||||
|
||||
export { type themeOption, themeSetting, theme };
|
||||
function useTheme() {
|
||||
document.documentElement.classList.add(theme.value);
|
||||
watch(theme, (newTheme, oldTheme) => {
|
||||
document.documentElement.classList.remove(oldTheme);
|
||||
document.documentElement.classList.add(newTheme);
|
||||
});
|
||||
}
|
||||
|
||||
export { type themeOption, themeSetting, theme, useTheme };
|
||||
|
||||
Reference in New Issue
Block a user