|
@@ -7,10 +7,13 @@ export function useTheme() {
|
|
|
|
|
|
function toggleTheme() {
|
|
function toggleTheme() {
|
|
const _theme = theme.value === "dark" ? "light" : "dark";
|
|
const _theme = theme.value === "dark" ? "light" : "dark";
|
|
- mode.value = _theme;
|
|
|
|
theme.value = _theme;
|
|
theme.value = _theme;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ watch(() => theme.value, newVal => mode.value = newVal, {
|
|
|
|
+ immediate: true,
|
|
|
|
+ });
|
|
|
|
+
|
|
const isDarkTheme = computed(() => theme.value === "dark");
|
|
const isDarkTheme = computed(() => theme.value === "dark");
|
|
|
|
|
|
return {
|
|
return {
|