mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
feat(dropdown): make Dropdown
slottable (#1182)
This commit is contained in:
parent
2858776367
commit
f5594daba6
7 changed files with 57 additions and 5 deletions
|
@ -4,6 +4,7 @@
|
|||
* @typedef {string} DropdownItemText
|
||||
* @typedef {{ id: DropdownItemId; text: DropdownItemText; }} DropdownItem
|
||||
* @event {{ selectedId: DropdownItemId, selectedItem: DropdownItem }} select
|
||||
* @slot {{ item: DropdownItem; index: number; }}
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -256,7 +257,9 @@
|
|||
highlightedIndex = i;
|
||||
}}"
|
||||
>
|
||||
{itemToString(item)}
|
||||
<slot item="{item}" index="{i}">
|
||||
{itemToString(item)}
|
||||
</slot>
|
||||
</ListBoxMenuItem>
|
||||
{/each}
|
||||
</ListBoxMenu>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue