feat(font): 添加本地字体选择功能(not done) #96

This commit is contained in:
log1997
2025-12-10 17:54:59 +08:00
parent 9dece20aa8
commit 3cd7788517
6 changed files with 161 additions and 43 deletions

View File

@@ -24,6 +24,7 @@ export const useGlobalConfig = defineStore('global', {
patternColor: '#1b66c9',
patternList: defaultPatternList as number[],
background: {}, // 背景颜色或图片
font: '',
},
musicList: defaultMusicList as IMusic[],
imageList: defaultImageList as IImage[],
@@ -106,6 +107,10 @@ export const useGlobalConfig = defineStore('global', {
getBackground(state) {
return state.globalConfig.theme.background
},
// 获取字体
getFont(state) {
return state.globalConfig.theme.font
},
// 获取是否显示头像
getIsShowAvatar(state) {
return state.globalConfig.isShowAvatar
@@ -232,6 +237,10 @@ export const useGlobalConfig = defineStore('global', {
setBackground(background: any) {
this.globalConfig.theme.background = background
},
// 设置字体
setFont(font: any) {
this.globalConfig.theme.font = font
},
// 设置是否显示头像
setIsShowAvatar(isShowAvatar: boolean) {
this.globalConfig.isShowAvatar = isShowAvatar
@@ -256,6 +265,7 @@ export const useGlobalConfig = defineStore('global', {
patternColor: '#1b66c9',
patternList: defaultPatternList as number[],
background: {}, // 背景颜色或图片
font: '',
},
musicList: defaultMusicList as IMusic[],
imageList: defaultImageList as IImage[],