<MyDropdown v-model="myDropdownValue">
<MyDropdownOption value="hi"/>
<MyDropdownOption value="hey"/>
<MyDropdownOption value="hello"/>
</MyDropdown>
In this repository, there are examples for:
This technique is called compound components - see Kent Dodds's original React article
- Headless UI Dropdown menu and its code - make sure to check out the rest of the components too. They're also compound
- Element Plus table and its code - it's crazy