Understanding $el, $refs, and $root.
Like a tool in your hand, $el refers to the specific element that triggered an event. It's for self-manipulation.
<button @click="useTool($el, 'Hammer')">Hammer</button>
Like specifically named workbenches, $refs lets you access any element within your component that you've given an x-ref name.
Task: No task assigned.
Task: No task assigned.
<div x-ref="woodworkingBench">...</div>
<button @click="assignTask($refs.woodworkingBench, '...')">Assign</button>
Like the main controls for the building, $root refers to the outermost element of your component (the one with x-data). It's for component-wide manipulation.
<div x-data="workshop">
<!-- This entire div is $root -->
<button @click="toggleLights($root)">Toggle Lights</button>
</div>