fix(setting.ts): 修改默认主题色值读取方式

Former-commit-id: 7624f5cb4a4e908a40bfa1baa8b72cca616b5e5f
This commit is contained in:
郝先瑞
2022-05-02 00:05:14 +08:00
parent 073640c03f
commit af8dec811b

View File

@@ -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,