mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-14 09:20:51 +08:00
11 lines
307 B
TypeScript
11 lines
307 B
TypeScript
import { useDark, useToggle } from '@vueuse/core'
|
|
|
|
export const isDark =
|
|
// @ts-expect-error when PROD is true, do not useDark
|
|
import.meta.env.DEV &&
|
|
useDark({
|
|
storageKey: 'el-theme-appearance',
|
|
})
|
|
// remove as boolean when dark mode is ok
|
|
export const toggleDark = useToggle(isDark as boolean)
|