From e035d1abcaa5f404297251dad50a78fa063e5128 Mon Sep 17 00:00:00 2001 From: robonen Date: Fri, 15 Aug 2025 04:37:58 +0700 Subject: [PATCH] docs(web/vue): update documentation for unrefElement function --- web/vue/src/composables/unrefElement/index.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/web/vue/src/composables/unrefElement/index.ts b/web/vue/src/composables/unrefElement/index.ts index d750541..3089e63 100644 --- a/web/vue/src/composables/unrefElement/index.ts +++ b/web/vue/src/composables/unrefElement/index.ts @@ -9,6 +9,24 @@ export type MaybeComputedElementRef = Ma export type UnRefElementReturn = T extends VueInstance ? Exclude : T | undefined; +/** + * @name unrefElement + * @category Components + * @description Unwraps a Vue element reference to get the underlying instance or DOM element. + * + * @param {MaybeComputedElementRef} elRef - The element reference to unwrap. + * @returns {UnRefElementReturn} - The unwrapped element or undefined. + * + * @example + * const element = useTemplateRef('element'); + * const result = unrefElement(element); // result is the element instance + * + * @example + * const component = useTemplateRef('component'); + * const result = unrefElement(component); // result is the component instance + * + * @since 0.0.11 + */ export function unrefElement(elRef: MaybeComputedElementRef): UnRefElementReturn { const plain = toValue(elRef); return (plain as VueInstance)?.$el ?? plain;