1<div x-data="{id: 1}">
2 <button @click="$dispatch('open-dropdown',{id})">Open Dropdown</button>
3</div>
4
5<ul x-data="{ open: false }"
6 x-show="open"
7 @open-dropdown.window="if ($event.detail.id == 1) open = true"
8 @click.away="open = false">
9 Dropdown Body
10</ul>