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/set.md
1---2category: Utilities3---45# set67Shorthand for `ref.value = x`89## Usage1011```ts12import { set } from '@vueuse/core'1314const a = ref(0)1516set(a, 1)1718console.log(a.value) // 119```2021## Type Declarations2223```ts24export declare function set<T>(ref: Ref<T>, value: T): void25export declare function set<O extends object, K extends keyof O>(26target: O,27key: K,28value: O[K],29): void30```31