diff --git a/src/main.js b/src/main.js index c01e80d..15580f6 100644 --- a/src/main.js +++ b/src/main.js @@ -4,7 +4,6 @@ import Cookies from 'js-cookie' import ElementPlus from 'element-plus' import 'element-plus/dist/index.css' -import 'element-plus/theme-chalk/dark/css-vars.css' import locale from 'element-plus/es/locale/lang/zh-cn' import '@/assets/styles/index.scss' // global css diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index 64b413a..85161fe 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -1,10 +1,6 @@ import defaultSettings from '@/settings' -import { useDark, useToggle } from '@vueuse/core' import { useDynamicTitle } from '@/utils/dynamicTitle' -const isDark = useDark() -const toggleDark = useToggle(isDark) - const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || '' @@ -22,7 +18,8 @@ const useSettingsStore = defineStore( fixedHeader: storageSetting.fixedHeader === undefined ? fixedHeader : storageSetting.fixedHeader, sidebarLogo: storageSetting.sidebarLogo === undefined ? sidebarLogo : storageSetting.sidebarLogo, dynamicTitle: storageSetting.dynamicTitle === undefined ? dynamicTitle : storageSetting.dynamicTitle, - isDark: isDark.value + // 关闭跟随系统的暗黑模式,默认使用亮色模式 + isDark: false }), actions: { // 修改布局设置 @@ -39,8 +36,8 @@ const useSettingsStore = defineStore( }, // 切换暗黑模式 toggleTheme() { + // 如果后续仍需保留“主题模式”按钮,仅切换内部标记,不再操作系统/HTML 的暗黑类名 this.isDark = !this.isDark - toggleDark() } } })