fix theme
This commit is contained in:
@@ -5,7 +5,7 @@ import UserLoginInfo from "../items/UserLoginInfo.vue";
|
||||
import SetingsIcon from "../assets/Icons/SetingsIcon.vue";
|
||||
import DarkModeIcone from "../assets/Icons/DarkModeIcone.vue";
|
||||
import LightModeIcone from "../assets/Icons/LightModeIcone.vue";
|
||||
import {ref} from "vue";
|
||||
import {onMounted, ref} from "vue";
|
||||
import router from "../router.ts";
|
||||
|
||||
|
||||
@@ -19,6 +19,12 @@ function switchThemeMode() {
|
||||
themeIs.value = newTheme;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const storedTheme = localStorage.getItem("theme");
|
||||
themeIs.value = storedTheme || "dark";
|
||||
document.documentElement.setAttribute("data-theme", storedTheme || "dark");
|
||||
});
|
||||
|
||||
function navigateToSettings() {
|
||||
router.push("/settings");
|
||||
}
|
||||
|
Reference in New Issue
Block a user