Skip to content

useFloor

反应式 Math.floor

¥Reactive Math.floor.

用法

¥Usage

ts
import { useFloor } from '@vueuse/math'

const value = ref(45.95)
const result = useFloor(value) // 45

类型声明

typescript
/**
 * Reactive `Math.floor`
 *
 * @see https://vueuse.org/useFloor
 */
export declare function useFloor(
  value: MaybeRefOrGetter<number>,
): ComputedRef<number>

源代码

源代码文档

变更日志

v12.8.0 on 3/5/2025
7432f - feat(types): deprecate MaybeRef and MaybeRefOrGetter in favor of Vue's native (#4636)

VueUse v13.0 中文网 - 粤ICP备13048890号