fix: 🐛 登录页设置的主题进入系统后不一致问题修复

Former-commit-id: 0f6344792e06a2c0b0e669d29d4e4f3797b10d7a
This commit is contained in:
hxr
2023-11-05 10:56:08 +08:00
parent bbc0a9e970
commit c797f61691
3 changed files with 8 additions and 12 deletions

View File

@@ -79,11 +79,8 @@ const currentThemeColor = computed(() => {
});
onMounted(() => {
window.document.body.setAttribute("layout", settingsStore.layout);
const theme =
localStorage.getItem("vueuse-color-scheme") || defaultSettings.theme;
settingsStore.changeSetting({ key: "theme", value: theme });
if (theme != "light") {
const theme = settingsStore.theme;
if (theme == "dark") {
document.documentElement.classList.add("dark");
}

View File

@@ -10,8 +10,6 @@ defineProps({
},
});
const layout = computed(() => settingsStore.layout);
const logo = ref(new URL(`../../../assets/logo.png`, import.meta.url).href);
</script>
@@ -36,8 +34,8 @@ const logo = ref(new URL(`../../../assets/logo.png`, import.meta.url).href);
to="/"
>
<img v-if="settingsStore.sidebarLogo" :src="logo" class="w-5 h-5" />
<span class="ml-3 text-white text-sm font-bold"
>vue3-element-admin</span
<span class="ml-3 text-white text-sm font-bold">
{{ $t("login.title") }}</span
>
</router-link>
</transition>