docs(dropdown-menu): update

This commit is contained in:
Benjamin Canac
2024-08-06 16:45:07 +02:00
parent 8d560bdd21
commit 39a63e8e3f
11 changed files with 485 additions and 48 deletions

View File

@@ -8,11 +8,14 @@ links:
## Usage
### Items
Use the `items` prop as an array of objects with the following properties:
- `label?: string`{lang="ts-type"}
- `icon?: string`{lang="ts-type"}
- `avatar?: AvatarProps`{lang="ts-type"}
- `class?: any`{lang="ts-type"}
- [`slot?: string`{lang="ts-type"}](#with-custom-slot)
You can also pass any property from the [Link](/components/link#props) component such as `to`, `target`, etc.
@@ -70,23 +73,57 @@ You can customize this icon globally in your `app.config.ts` under `ui.icons.che
## Examples
### With custom slot
Use the `slot` property to customize a specific item with a dropdown menu for example.
:component-example{name="breadcrumb-custom-slot-example"}
### With separator slot
Use the `#separator` slot to customize the separator between each item.
:component-example{name="breadcrumb-separator-slot-example"}
### With custom slot
Use the `slot` property to customize a specific item.
You will have access to the following slots:
- `{{ item.slot }}`{lang="ts-type"}
- `{{ item.slot }}-leading`{lang="ts-type"}
- `{{ item.slot }}-label`{lang="ts-type"}
- `{{ item.slot }}-trailing`{lang="ts-type"}
:component-example{name="breadcrumb-custom-slot-example"}
::tip{to="#slots"}
You can also use the `item`, `item-leading`, `item-label` and `item-trailing` slots to customize all items.
::
## API
### Props
:component-props
::component-props
---
ignore:
- as
- to
- target
- active
- activeClass
- inactiveClass
- exactActiveClass
- ariaCurrentValue
- href
- rel
- noRel
- prefetch
- noPrefetch
- prefetchedClass
- replace
- exact
- exactQuery
- exactHash
- external
---
::
### Slots