This commit is contained in:
kailong321200875
2024-01-15 09:46:41 +08:00
parent 0f531fd1d0
commit 59d4ed4dd9
3 changed files with 61 additions and 48 deletions

View File

@@ -3,7 +3,7 @@ import { LoginForm, RegisterForm } from './components'
import { ThemeSwitch } from '@/components/ThemeSwitch'
import { LocaleDropdown } from '@/components/LocaleDropdown'
import { useI18n } from '@/hooks/web/useI18n'
import { underlineToHump } from '@/utils'
import { getCssVar, underlineToHump } from '@/utils'
import { useAppStore } from '@/store/modules/app'
import { useDesign } from '@/hooks/web/useDesign'
import { ref } from 'vue'
@@ -26,6 +26,12 @@ const toRegister = () => {
const toLogin = () => {
isLogin.value = true
}
const themeChange = () => {
const color = getCssVar('--el-bg-color')
appStore.setMenuTheme(color)
appStore.setHeaderTheme(color)
}
</script>
<template>
@@ -66,7 +72,7 @@ const toLogin = () => {
</div>
<div class="flex justify-end items-center space-x-10px">
<ThemeSwitch />
<ThemeSwitch @change="themeChange" />
<LocaleDropdown class="lt-xl:text-white dark:text-white" />
</div>
</div>