From d575852b50481e9cd8399bbea15de8f210a41e1f Mon Sep 17 00:00:00 2001 From: JenniferW <1627055433@qq.com> Date: Fri, 19 Dec 2025 16:10:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=97=E9=BB=91=E6=A8=A1=E5=BC=8F=E5=8E=BB?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 1 - src/store/modules/settings.js | 9 +++------ 2 files changed, 3 insertions(+), 7 deletions(-) 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() } } })