vue-lynx / ref

Function: ref()

ref(value)

function ref<T>(value): [T] extends [Ref] ? IfAny<T, Ref<T>, T> : Ref<UnwrapRef<T>, UnwrapRef<T> | T>

Takes an inner value and returns a reactive and mutable ref object, which has a single property .value that points to the inner value.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
valueTThe object to wrap in the ref.

Returns

[T] extends [Ref] ? IfAny<T, Ref<T>, T> : Ref<UnwrapRef<T>, UnwrapRef<T> | T>

See

https://vuejs.org/api/reactivity-core.html#ref

Defined in

node_modules/.pnpm/@vue+reactivity@3.5.30/node_modules/@vue/reactivity/dist/reactivity.d.ts:440

ref()

function ref<T>(): Ref<T | undefined>

Type Parameters

Type ParameterDefault type
Tany

Returns

Ref<T | undefined>

Defined in

node_modules/.pnpm/@vue+reactivity@3.5.30/node_modules/@vue/reactivity/dist/reactivity.d.ts:441