useRound
響應式的 Math.round
。
用法
ts
import { useRound } from '@vueuse/math'
const value = ref(20.49)
const result = useRound(value) // 20
類型宣告
typescript
/**
* Reactive `Math.round`.
*
* @see https://vueuse.dev.org.tw/useRound
*/
export declare function useRound(
value: MaybeRefOrGetter<number>,
): ComputedRef<number>
原始碼
貢獻者
變更日誌
v12.8.0
於 2025/3/5v12.3.0
於 2025/1/259f75
- feat(toValue): 棄用 @vueuse/shared
中的 toValue
,改用 Vue 原生方法v12.0.0-beta.1
於 2024/11/21v10.0.0-beta.4
於 2023/4/134d757
- feat(types)!: 將 MaybeComputedRef
重新命名為 MaybeRefOrGetter
0a72b
- feat(toValue): 將 resolveUnref
重新命名為 toValue