跳到主要內容

useRound

分類
導出大小
145 B
套件
@vueuse/math
上次變更
5 天前

響應式的 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>

原始碼

原始碼文件

貢獻者

Anthony Fu
Anthony Fu
IlyaL
webfansplz

變更日誌

v12.8.0 於 2025/3/5
7432f - feat(types): 棄用 MaybeRefMaybeRefOrGetter,改用 Vue 原生方法 (#4636)
v12.3.0 於 2025/1/2
59f75 - feat(toValue): 棄用 @vueuse/shared 中的 toValue,改用 Vue 原生方法
v12.0.0-beta.1 於 2024/11/21
0a9ed - feat!: 移除 Vue 2 支援、優化 bundles 並清理程式碼 (#4349)
v10.0.0-beta.4 於 2023/4/13
4d757 - feat(types)!: 將 MaybeComputedRef 重新命名為 MaybeRefOrGetter
0a72b - feat(toValue): 將 resolveUnref 重新命名為 toValue

依 MIT 授權條款發布。