默认固定为亮色模式

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()

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

View File

@@ -10,12 +10,12 @@
<screenfull id="screenfull" class="right-menu-item hover-effect" />
<el-tooltip content="主题模式" effect="dark" placement="bottom">
<!-- <el-tooltip content="主题模式" effect="dark" placement="bottom">
<div class="right-menu-item hover-effect theme-switch-wrapper" @click="toggleTheme">
<svg-icon v-if="settingsStore.isDark" icon-class="sunny" />
<svg-icon v-if="!settingsStore.isDark" icon-class="moon" />
</div>
</el-tooltip>
</el-tooltip> -->
<!-- <el-tooltip content="布局大小" effect="dark" placement="bottom">
<size-select id="size-select" class="right-menu-item hover-effect" />

View File

@@ -7,7 +7,7 @@ export default {
/**
* 侧边栏主题 深色主题theme-dark浅色主题theme-light
*/
sideTheme: 'theme-light',
sideTheme: 'theme-dark',
/**
* 是否系统布局配置