goview_vue/src/utils/style.ts

12 lines
345 B
TypeScript
Raw Normal View History

2021-12-15 22:16:16 +08:00
import { useDesignStore } from '@/store/modules/designStore/designStore'
export const setHtmlTheme = (themeName?: string) => {
const e = window.document.documentElement
if (themeName) {
e.setAttribute('data-theme', themeName)
2021-12-15 22:16:16 +08:00
return
}
const designStore = useDesignStore()
e.setAttribute('data-theme', designStore.themeName)
}