mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
feat(ContextMenu/DropdownMenu): handle checkbox items type
Resolves #2144
This commit is contained in:
@@ -22,7 +22,7 @@ Use the `items` prop as an array of objects with the following properties:
|
||||
- `icon?: string`{lang="ts-type"}
|
||||
- `avatar?: AvatarProps`{lang="ts-type"}
|
||||
- `kbds?: string[] | KbdProps[]`{lang="ts-type"}
|
||||
- `type?: "link" | "label" | "separator"`{lang="ts-type"}
|
||||
- [`type?: "link" | "label" | "separator" | "checkbox"`{lang="ts-type"}](#with-checkbox-items)
|
||||
- `disabled?: boolean`{lang="ts-type"}
|
||||
- `class?: any`{lang="ts-type"}
|
||||
- [`slot?: string`{lang="ts-type"}](#with-custom-slot)
|
||||
@@ -174,6 +174,21 @@ slots:
|
||||
|
||||
## Examples
|
||||
|
||||
### With checkbox items
|
||||
|
||||
You can use the `type` property with `checkbox` and use the `checked` / `onUpdateChecked` properties to control the checked state of the item.
|
||||
|
||||
::component-example
|
||||
---
|
||||
collapse: true
|
||||
name: 'context-menu-checkbox-items-example'
|
||||
---
|
||||
::
|
||||
|
||||
::note
|
||||
To ensure reactivity for the `checked` state of items, it's recommended to wrap your `items` array inside a `computed`.
|
||||
::
|
||||
|
||||
### With custom slot
|
||||
|
||||
Use the `slot` property to customize a specific item.
|
||||
|
||||
Reference in New Issue
Block a user