usePreferredReducedTransparency
Reactive prefers-reduced-transparency media query.
示例
Usage
js
import { usePreferredReducedTransparency } from '@vueuse/core'
const preferredTransparency = usePreferredReducedTransparency()
Component Usage
This function also provides a renderless component version via the
@vueuse/components
package. Learn more about the usage.
vue
<template>
<UsePreferredReducedTransparency v-slot="{ transparency }">
Preferred Reduced transparency: {{ transparency }}
</UsePreferredReducedTransparency>
</template>
类型声明
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>
源码
贡献者
huiliangShen
更新日志
v12.2.0-beta.1
on 12/23/2024