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