Skip to content

usePreferredReducedTransparency ​

类别
导出体积
1.18 kB
上次更改
last year

反应式 prefers-reduced-transparency 媒体查询。

示例 ​

Preferred Transparency:
no-preference

使用方法 ​

ts
import { 
usePreferredReducedTransparency
} from '@vueuse/core'
const
preferredTransparency
=
usePreferredReducedTransparency
()

组件用法 ​

vue
<template>
  <UsePreferredReducedTransparency v-slot="{ 
transparency
}">
Preferred Reduced transparency: {{
transparency
}}
</UsePreferredReducedTransparency> </template>

类型声明 ​

ts
export type 
ReducedTransparencyType
= "reduce" | "no-preference"
/** * Reactive prefers-reduced-transparency media query. * * @see https://vueuse.org/usePreferredReducedTransparency * @param [options] * * @__NO_SIDE_EFFECTS__ */ export declare function
usePreferredReducedTransparency
(
options
?:
ConfigurableWindow
,
):
ComputedRef
<
ReducedTransparencyType
>

源码 ​

源码 • 演示 • 文档

贡献者 ​

一纸忘忧
SerKo
huiliangShen

更新日志 ​

d32f8 - refactor: add @__NO_SIDE_EFFECTS__ annotations to all pure functions (#4907)
34cd7 - feat: add new function (#4201)