R
fn

unrefElement

v0.0.11testeddemo

Unwraps a Vue element reference to get the underlying instance or DOM element.

Examples

ts
const element = useTemplateRef<HTMLElement>('element');
const result = unrefElement(element); // result is the element instance
ts
const component = useTemplateRef<Component>('component');
const result = unrefElement(component); // result is the component instance

Demo

Loading demo…

Signature

ts
export function unrefElement<El extends MaybeElement>(elRef: MaybeComputedElementRef<El>): UnRefElementReturn<El>{ ... }

Type Parameters

Elextends MaybeElement

Parameters

ParameterTypeDescription
elRefMaybeComputedElementRef<El>The element reference to unwrap.

Returns

UnRefElementReturn<El>- The unwrapped element or undefined.