refactor: 登录页调整

This commit is contained in:
meilin.huang
2023-09-23 22:52:05 +08:00
parent 6681dc1057
commit a1eca3d691
18 changed files with 506 additions and 256 deletions

View File

@@ -140,5 +140,17 @@ export const useThemeConfig = defineStore('themeConfig', {
setThemeConfig(data: ThemeConfigState) {
this.themeConfig = data.themeConfig;
},
// 切换暗模式
switchDark(isDark: boolean) {
this.themeConfig.isDark = isDark;
const body = document.documentElement as HTMLElement;
if (isDark) {
body.setAttribute('class', 'dark');
this.themeConfig.editorTheme = 'vs-dark';
} else {
body.setAttribute('class', '');
this.themeConfig.editorTheme = 'SolarizedLight';
}
},
},
});