默认固定为亮色模式

This commit is contained in:
砂糖
2025-09-05 16:41:49 +08:00
parent 5cf7fad689
commit 934105f644
4 changed files with 11 additions and 3 deletions

View File

@@ -7,10 +7,18 @@ import useSettingsStore from '@/store/modules/settings'
import { handleThemeStyle } from '@/utils/theme'
import useProductStore from '@/store/modules/product'
import { getToken } from '@/utils/auth'
import { useDark } from '@vueuse/core'
const isDark = useDark()
onMounted(() => {
nextTick(() => {
// 初始化主题样式
console.log(isDark.value)
if (isDark.value) {
useSettingsStore().toggleTheme()
}
handleThemeStyle(useSettingsStore().theme)
if (getToken()) {
useProductStore().fetchProductMap()