主题
usePreferredContrast
反应式 prefers-contrast 媒体查询。
¥Reactive prefers-contrast media query.
示例
用法
¥Usage
js
import { usePreferredContrast } from '@vueuse/core'
const preferredContrast = usePreferredContrast()
组件用法
¥Component Usage
vue
<template>
<UsePreferredContrast v-slot="{ contrast }">
Preferred Contrast: {{ contrast }}
</UsePreferredContrast>
</template>
类型声明
typescript
export type ContrastType = "more" | "less" | "custom" | "no-preference"
/**
* Reactive prefers-contrast media query.
*
* @see https://vueuse.org/usePreferredContrast
* @param [options]
*/
export declare function usePreferredContrast(
options?: ConfigurableWindow,
): ComputedRef<ContrastType>