Ben Lin
2024-08-21 947cafbb9c59261d0d7252a70bbbca8690c5cbc4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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,
  };
}