Skip to content

useRound

反应式 Math.round

¥Reactive Math.round.

用法

¥Usage

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

const value = ref(20.49)
const result = useRound(value) // 20

类型声明

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

源代码

源代码文档

变更日志

7432f - feat(types): deprecate MaybeRef and MaybeRefOrGetter in favor of Vue's native (#4636)

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