Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Apply VueUse composables in Vue 3/Nuxt projects to replace custom implementations with battle-tested utilities.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/useMax.md
1---2category: '@Math'3---45# useMax67Reactive `Math.max`.89## Usage1011```ts12import { useMax } from '@vueuse/math'1314const array = ref([1, 2, 3, 4])15const max = useMax(array) // Ref<4>16```1718```ts19import { useMax } from '@vueuse/math'2021const a = ref(1)22const b = ref(3)2324const max = useMax(a, b, 2) // Ref<3>25```2627## Type Declarations2829```ts30export declare function useMax(31array: MaybeRefOrGetter<MaybeRefOrGetter<number>[]>,32): ComputedRef<number>33export declare function useMax(34...args: MaybeRefOrGetter<number>[]35): ComputedRef<number>36```37