Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
Add dark model async vbenjs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jzow committed Sep 22, 2023
1 parent 627781d commit 50f6114
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/hooks/setting/useDarkModeTheme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { computed } from 'vue';
import { theme } from 'ant-design-vue';
import { useRootSetting } from '/@/hooks/setting/useRootSetting';
import { ThemeEnum } from '/@/enums/appEnum';

export function useDarkModeTheme() {
const { getDarkMode } = useRootSetting();
const { darkAlgorithm } = theme;
const isDark = computed(() => getDarkMode.value === ThemeEnum.DARK);
const darkTheme = {
algorithm: [darkAlgorithm],
};

return {
isDark,
darkTheme,
};
}

0 comments on commit 50f6114

Please sign in to comment.