- import { useDesignStore } from '@/store/modules/designStore'
- export const useDarkThemeHook = () => {
- const designStore = useDesignStore()
- if(designStore.getDarkTheme){
- // 设置为暗黑主题
- document.body.removeAttribute('arco-theme');
- }else{
- // 恢复亮色主题
- document.body.setAttribute('arco-theme', 'dark')
- }
- }
|