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