默认固定为亮色模式
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user