Understanding `$el`, `$refs`, and `$root`
Awaiting engineer actions...
An element refers to itself. Like a track button that knows how to 'solo' or 'mute' itself.
Digital Audio Workstation (DAW) Tracks
<button @click="toggleTrackState($el, 'Solo')">
Track 1: Vocals
</button>
Access any named element from anywhere in the component. Like a central mixing board controlling specific, named pieces of gear.
Mixing Board
<div x-ref="mic1">...</div>
<button @click="adjustEquipment('mic1')">
...
</button>
// In JS: this.$refs.mic1.classList.add(...)
Access the top-level component element. Like a master power switch that affects the entire studio at once.
Studio Master Controls
This button affects the entire demo area, including the other panels.
<div x-data="studioDemo">
...
<button @click="togglePower($root)">
...
</button>
</div>