refactor: Refactor Naive UI AppProvider

This commit is contained in:
张传龙
2022-06-19 17:11:38 +08:00
parent 21c1d6d3aa
commit e128dfabc7
11 changed files with 149 additions and 165 deletions

View File

@@ -2,9 +2,19 @@ import { defineStore } from 'pinia'
import { themeSettings } from '@/settings'
export const useThemeStore = defineStore('theme', {
state() {
return themeSettings
return {
tags: themeSettings.tag || { visible: true, height: 50 },
header: themeSettings.header || { height: 60 },
naiveThemeOverrides: themeSettings.naiveThemeOverrides || {
common: {
primaryColor: '#316C72FF',
primaryColorHover: '#316C72E3',
primaryColorPressed: '#2B4C59FF',
primaryColorSuppl: '#316C7263',
},
},
}
},
getters: {},
actions: {
setTabVisible(visible) {
this.tags.visible = visible