mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-18 07:10:26 +08:00
refactor: 登录页调整
This commit is contained in:
@@ -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';
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user