Skip to content

useMax

Category
Export Size
190 B
Package
@vueuse/math
Last Changed
15 minutes ago

响应式 Math.max.

用法

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

const array = ref([1, 2, 3, 4])
const max = useMax(array) // Ref<4>
ts
import { useMax } from '@vueuse/math'

const a = ref(1)
const b = ref(3)

const max = useMax(a, b, 2) // Ref<3>

类型声明

typescript
export declare function useMax(
  array: MaybeRefOrGetter<MaybeRefOrGetter<number>[]>,
): ComputedRef<number>
export declare function useMax(
  ...args: MaybeRefOrGetter<number>[]
): ComputedRef<number>

Source

SourceDocs

贡献者

Anthony Fu
丶远方
Anthony Fu
Ted Xu
Frank Fang

变更日志

v10.0.0-beta.4 on 4/13/2023
4d757 - feat(types)!: rename MaybeComputedRef to MaybeRefOrGetter
0a72b - feat(toValue): rename resolveUnref to toValue

Released under the MIT License.