From e08263ff3886b43030c9c8903ecce510f10fef12 Mon Sep 17 00:00:00 2001 From: "Haytham A. Salama" Date: Wed, 12 Jul 2023 15:52:57 +0300 Subject: [PATCH] docs(Dropdown): add an example item slot (#304) Co-authored-by: Benjamin Canac --- .../content/examples/DropdownExampleSlot.vue | 47 ++++++++++++++ docs/content/2.elements/4.dropdown.md | 64 +++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 docs/components/content/examples/DropdownExampleSlot.vue diff --git a/docs/components/content/examples/DropdownExampleSlot.vue b/docs/components/content/examples/DropdownExampleSlot.vue new file mode 100644 index 00000000..80a3dea0 --- /dev/null +++ b/docs/components/content/examples/DropdownExampleSlot.vue @@ -0,0 +1,47 @@ + + + diff --git a/docs/content/2.elements/4.dropdown.md b/docs/content/2.elements/4.dropdown.md index 67b7e71b..f2667880 100644 --- a/docs/content/2.elements/4.dropdown.md +++ b/docs/content/2.elements/4.dropdown.md @@ -12,8 +12,10 @@ Pass an array of arrays to the `items` prop of the Dropdown component. Each arra - `label` - The label of the item. - `icon` - The icon of the item. +- `iconClass` - The class of the icon of the item. - `avatar` - The avatar of the item. You can pass all the props of the [Avatar](/elements/avatar) component. - `shortcuts` - The shortcuts of the item. +- `slot` - The slot of the item. - `disabled` - Whether the item is disabled. - `click` - The click handler of the item. @@ -95,6 +97,68 @@ const items = [ ``` :: +## Slots + +### `item` + +Use the `#item` slot to customize the items content or pass a `slot` property to customize a specific item. You will have access to the `item` property in the slot scope. + +::component-example +#default +:dropdown-example-slot + +#code +```vue + + + +``` +:: + ## Props :component-props