fix(setting.ts): 修改默认主题色值读取方式
Former-commit-id: 7624f5cb4a4e908a40bfa1baa8b72cca616b5e5f
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user