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