T
UseCurrentElementReturn
testeddemoInfer the resolved element type. When no explicit generic is supplied (`T` stays the broad `MaybeElement`) we fall back to the component instance's `$el` type — unless that is `any` (the un-typed default), in which case we keep `MaybeElement`.
Demo
Loading demo…
Signature
ts
export type UseCurrentElementReturn<
T extends MaybeElement = MaybeElement,
R extends VueInstance = VueInstance,
E extends MaybeElement = MaybeElement extends T
? IsAny<R['$el']> extends false ? R['$el'] : T
: T,
> = ComputedRefWithControl<E>;Type Parameters
Textends MaybeElement= MaybeElementRextends VueInstance= VueInstanceEextends MaybeElement= MaybeElement extends T
? IsAny<R['$el']> extends false ? R['$el'] : T
: T