From af8dec811bbece105b028fc6f9ebd1e3f32b1e33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=85=88=E7=91=9E?= <1490493387@qq.com> Date: Mon, 2 May 2022 00:05:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(setting.ts):=20=E4=BF=AE=E6=94=B9=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E4=B8=BB=E9=A2=98=E8=89=B2=E5=80=BC=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 7624f5cb4a4e908a40bfa1baa8b72cca616b5e5f --- src/store/modules/settings.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/modules/settings.ts b/src/store/modules/settings.ts index 069c75ca..de344526 100644 --- a/src/store/modules/settings.ts +++ b/src/store/modules/settings.ts @@ -4,12 +4,12 @@ import defaultSettings from '../../settings' import { localStorage } from "@/utils/storage"; const { showSettings, tagsView, fixedHeader, sidebarLogo } = defaultSettings -import variables from '@/styles/element-variables.module.scss' +const el = document.documentElement export const useSettingStore = defineStore({ id: "setting", state: (): SettingState => ({ - theme: localStorage.get("theme") || variables.theme, + theme: localStorage.get("theme") || getComputedStyle(el).getPropertyValue(`--el-color-primary`), showSettings: showSettings, tagsView: localStorage.get("tagsView") != null ? localStorage.get("tagsView") : tagsView, fixedHeader: fixedHeader,