mirror of
https://gitee.com/log4j/pig-ui.git
synced 2024-12-22 21:22:33 +08:00
支持 tailwindcss 深色模式
Signed-off-by: lbw <wangiegie@163.com>
This commit is contained in:
parent
10357f27f7
commit
a32c2ae27b
@ -553,8 +553,14 @@ const onAddFilterChange = (attr: string) => {
|
||||
// 4、界面显示 --> 深色模式
|
||||
const onAddDarkChange = () => {
|
||||
const body = document.documentElement as HTMLElement;
|
||||
if (getThemeConfig.value.isIsDark) body.setAttribute('data-theme', 'dark');
|
||||
else body.setAttribute('data-theme', '');
|
||||
if (getThemeConfig.value.isIsDark) {
|
||||
body.setAttribute('data-theme', 'dark');
|
||||
// body 再增加一个 dark : true 的class ,用于tailwindcss 判断是否是深色
|
||||
body.classList.add('dark');
|
||||
} else {
|
||||
body.classList.remove('dark');
|
||||
body.setAttribute('data-theme', '');
|
||||
}
|
||||
};
|
||||
// 4、界面显示 --> 开启水印
|
||||
const onWartermarkChange = () => {
|
||||
|
Loading…
Reference in New Issue
Block a user