主题
usePreferredDark
反应式深色主题偏好。
¥Reactive dark theme preference.
示例
用法
¥Usage
js
import { usePreferredDark } from '@vueuse/core'
const isDark = usePreferredDark()
组件用法
¥Component Usage
vue
<template>
<UsePreferredDark v-slot="{ prefersDark }">
Prefers Dark: {{ prefersDark }}
</UsePreferredDark>
</template>
类型声明
typescript
/**
* Reactive dark theme preference.
*
* @see https://vueuse.org/usePreferredDark
* @param [options]
*/
export declare function usePreferredDark(
options?: ConfigurableWindow,
): Ref<boolean, boolean>