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/useAverage.md
1---2category: '@Math'3---45# useAverage67Get the average of an array reactively.89## Usage1011```ts12import { useAverage } from '@vueuse/math'1314const list = ref([1, 2, 3])15const averageValue = useAverage(list) // Ref<2>16```1718```ts19import { useAverage } from '@vueuse/math'2021const a = ref(1)22const b = ref(3)2324const averageValue = useAverage(a, b) // Ref<2>25```2627## Type Declarations2829```ts30export declare function useAverage(31array: MaybeRefOrGetter<MaybeRefOrGetter<number>[]>,32): ComputedRef<number>33export declare function useAverage(34...args: MaybeRefOrGetter<number>[]35): ComputedRef<number>36```37