Skip to content

Commit

Permalink
!91 支持 tailwindcss 深色模式
Browse files Browse the repository at this point in the history
Merge pull request !91 from lbw/N/A
  • Loading branch information
lbw authored and gitee-org committed Sep 12, 2024
2 parents 10357f2 + a32c2ae commit e3d35eb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/layout/navBars/breadcrumb/setings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down

0 comments on commit e3d35eb

Please sign in to comment.