Summary
Document the data-ax-ref="elementName" template directive and the corresponding this.$refs.elementName instance property on AvenxComponent.
Context & Current State
The framework supports the data-ax-ref="elementName" directive within component templates (implemented in AvenxComponent.js), which automatically captures and binds direct DOM element references or nested child component instances to this.$refs.elementName. However, neither directives.md nor component.md documents how to use data-ax-ref or access this.$refs.
Proposed Documentation Changes
- Directives Reference (
docs/src/content/docs/core-concepts/directives.md):
- Add a section explaining
data-ax-ref for binding element references in templates.
- Include code examples demonstrating form input focus, canvas context retrieval, and child component inspection via
$refs.
- Component API Reference (
docs/src/content/docs/api-reference/component.md):
- Document the
this.$refs instance property, its type (Record<string, Element | AvenxComponent>), and its availability in lifecycle hooks (onMount, onUpdate).
- Detail the internal reference caching mechanism and automatic cleanup during component unmounting.
Labels
documentation
enhancement
good first issue
Summary
Document the
data-ax-ref="elementName"template directive and the correspondingthis.$refs.elementNameinstance property onAvenxComponent.Context & Current State
The framework supports the
data-ax-ref="elementName"directive within component templates (implemented inAvenxComponent.js), which automatically captures and binds direct DOM element references or nested child component instances tothis.$refs.elementName. However, neitherdirectives.mdnorcomponent.mddocuments how to usedata-ax-refor accessthis.$refs.Proposed Documentation Changes
docs/src/content/docs/core-concepts/directives.md):data-ax-reffor binding element references in templates.$refs.docs/src/content/docs/api-reference/component.md):this.$refsinstance property, its type (Record<string, Element | AvenxComponent>), and its availability in lifecycle hooks (onMount,onUpdate).Labels
documentationenhancementgood first issue