This commit is contained in:
2026-03-09 09:39:08 +08:00
parent 1b24d0284e
commit a75f9805a8
6 changed files with 69 additions and 9 deletions

46
src/utils/theme/theme.ts Normal file
View File

@ -0,0 +1,46 @@
/**
* 主题样式
*/
export interface ThemeCss {
leftImg?: string;
topImg?: string;
backColor: string;
borderColor: string;
hoverColor: string;
activeColor: string;
textColor?: string;
}
/**
* 主题详情
*/
export class ThemeInfo {
name: string;
css: ThemeCss;
constructor(name: string, css: ThemeCss) {
this.name = name;
this.css = css;
}
};
export const ThemeType = {
DEFAULT: new ThemeInfo('default', { leftImg: '', topImg: '', backColor: '', borderColor: '', hoverColor: '', activeColor: '', textColor: '' }),
LIGHT: new ThemeInfo('light', { leftImg: '', topImg: '', backColor: '', borderColor: '', hoverColor: '', activeColor: '', textColor: '' }),
}
export const AppTheme = {
info:ThemeType.DEFAULT,
setTheme(theme: ThemeInfo) {
this.info = theme;
},
getTheme() {
return this.info;
},
getThemeCss() {
return this.info.css;
},
}