优化切换主题色

This commit is contained in:
不做码农
2022-04-29 13:00:22 +08:00
parent 6ee3008470
commit 742a37aac6
3 changed files with 38 additions and 23 deletions
+3 -4
View File
@@ -1,12 +1,12 @@
import defaultSettings from '@/settings'
import { useDynamicTitle } from '@/utils/dynamicTitle'
const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings
const { sideTheme, theme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings
const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || ''
const state = {
title: '',
theme: storageSetting.theme || '#409EFF',
theme: storageSetting.theme || theme,
sideTheme: storageSetting.sideTheme || sideTheme,
showSettings: showSettings,
topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav,
@@ -40,5 +40,4 @@ export default {
state,
mutations,
actions
}
}