fn
unrefElement
v0.0.11testeddemoUnwraps 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 instancets
const component = useTemplateRef<Component>('component');
const result = unrefElement(component); // result is the component instanceDemo
Loading demo…
Signature
ts
export function unrefElement<El extends MaybeElement>(elRef: MaybeComputedElementRef<El>): UnRefElementReturn<El>{ ... }Type Parameters
Elextends MaybeElementParameters
| Parameter | Type | Description |
|---|---|---|
elRef | MaybeComputedElementRef<El> | The element reference to unwrap. |
Returns
UnRefElementReturn<El>- The unwrapped element or undefined.