usePreferredReducedTransparency
响应式的 prefers-reduced-transparency 媒体查询。
Demo
用法
js
import { usePreferredReducedTransparency } from '@vueuse/core'
const preferredTransparency = usePreferredReducedTransparency()
组件用法
vue
<template>
<UsePreferredReducedTransparency v-slot="{ transparency }">
首选减少透明度: {{ transparency }}
</UsePreferredReducedTransparency>
</template>
Type Declarations
typescript
export type ReducedTransparencyType = "reduce" | "no-preference"
/**
* Reactive prefers-reduced-transparency media query.
*
* @see https://vueuse.org/usePreferredReducedTransparency
* @param [options]
*/
export declare function usePreferredReducedTransparency(
options?: ConfigurableWindow,
): ComputedRef<ReducedTransparencyType>