mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
颜色更换
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { useDesignStore } from '@/store/modules/designStore/designStore'
|
||||
import { theme as themeEnum } from '@/settings/designSetting'
|
||||
|
||||
export const setHtmlTheme = (themeName?: string) => {
|
||||
const e = window.document.documentElement
|
||||
if (themeName) {
|
||||
e.setAttribute("data-theme", themeName);
|
||||
return
|
||||
}
|
||||
const designStore = useDesignStore()
|
||||
e.setAttribute("data-theme", designStore.getDarkTheme ? themeEnum.darkThemeName : themeEnum.lightThemeName);
|
||||
}
|
||||
Reference in New Issue
Block a user