2020-08-13 11:47:56 +08:00
|
|
|
# CheckButtonGroup
|
|
|
|
|
|
|
|
## Demos
|
|
|
|
|
|
|
|
### Size variants
|
|
|
|
|
2021-10-20 01:11:27 +08:00
|
|
|
Available values for the [`ui`](#props-ui) prop: `s` / `m`.
|
2020-08-13 11:47:56 +08:00
|
|
|
|
|
|
|
[[ demo src="/demo/check-button-group/default.vue" ]]
|
|
|
|
|
|
|
|
## API
|
|
|
|
|
|
|
|
### Props
|
|
|
|
|
|
|
|
| Name | Type | Default | Description |
|
|
|
|
| -- | -- | -- | -- |
|
2021-10-20 01:11:27 +08:00
|
|
|
| ``ui`` | `string=` | - | [^ui] |
|
|
|
|
| ``items`` | `Array<Object>` | `[]` | [^items] |
|
|
|
|
| ``value`` | `Array` | `[]` | [^value] |
|
|
|
|
| ``disabled`` | `boolean=` | `false` | Whether the check button group is disabled. |
|
|
|
|
| ``readonly`` | `boolean=` | `false` | Whether the check button group is read-only. |
|
|
|
|
| ``empty-value`` | `*` | - | The value to be selected when all selected values are deselected. Used when `exclusive` items are present. |
|
2020-08-13 11:47:56 +08:00
|
|
|
|
|
|
|
^^^ui
|
|
|
|
Style variants.
|
|
|
|
|
|
|
|
+++Enum values
|
|
|
|
| Value | Description |
|
|
|
|
| -- | -- |
|
|
|
|
| `s` | Small. |
|
2020-09-22 11:06:13 +08:00
|
|
|
| `m` | Medium. |
|
2021-10-28 15:51:45 +08:00
|
|
|
| `simple` | Simple style. |
|
|
|
|
| `stable` | Stable width layout. Every button will have a minimal width so that it'll be easier to align buttons across multiple rows. |
|
2020-08-13 11:47:56 +08:00
|
|
|
^^^
|
|
|
|
|
|
|
|
^^^items
|
2020-09-22 11:06:13 +08:00
|
|
|
The datasource of items with the item type being `{label, value, disabled, exclusive ...}`.
|
2020-08-13 11:47:56 +08:00
|
|
|
|
|
|
|
+++Properties
|
|
|
|
| Name | Type | Description |
|
|
|
|
| -- | -- | -- |
|
|
|
|
| `label` | `string` | The descriptive label of the item. |
|
|
|
|
| `value` | `*` | The value of the item. |
|
|
|
|
| `disabled` | `boolean=` | Whether the item is disabled. |
|
|
|
|
+++
|
|
|
|
^^^
|
|
|
|
|
|
|
|
^^^value
|
|
|
|
:::badges
|
|
|
|
`v-model`
|
|
|
|
:::
|
|
|
|
|
|
|
|
The `value`s of the selected items.
|
|
|
|
^^^
|
|
|
|
|
|
|
|
### Slots
|
|
|
|
|
|
|
|
| Name | Description |
|
|
|
|
| -- | -- |
|
2021-10-20 01:11:27 +08:00
|
|
|
| ``item`` | [^slot-item] |
|
2020-08-13 11:47:56 +08:00
|
|
|
|
2020-12-22 16:33:30 +08:00
|
|
|
^^^slot-item
|
2021-10-20 01:11:27 +08:00
|
|
|
The label content of each button. Displays the value of the `label` property by default.
|
2020-08-13 11:47:56 +08:00
|
|
|
|
2022-01-24 18:53:52 +08:00
|
|
|
+++Slot props
|
2020-08-13 11:47:56 +08:00
|
|
|
| Name | Type | Description |
|
|
|
|
| -- | -- | -- |
|
|
|
|
| `label` | `string` | The descriptive label of the item. |
|
|
|
|
| `value` | `*` | The value of the item. |
|
|
|
|
| `index` | `number` | The index of the item within `items`. |
|
|
|
|
| `disabled` | `boolean=` | Whether the item is disabled. |
|
|
|
|
+++
|
|
|
|
|
2022-01-24 18:53:52 +08:00
|
|
|
Additionally, custom properties apart from the listed ones will also be passes into the slot props object via `v-bind`.
|
2020-08-13 11:47:56 +08:00
|
|
|
^^^
|
|
|
|
|
|
|
|
### Events
|
|
|
|
|
|
|
|
| Name | Description |
|
|
|
|
| -- | -- |
|
2021-10-20 01:11:27 +08:00
|
|
|
| ``change`` | [^event-change] |
|
2020-08-13 11:47:56 +08:00
|
|
|
|
|
|
|
^^^event-change
|
|
|
|
:::badges
|
|
|
|
`v-model`
|
|
|
|
:::
|
|
|
|
|
|
|
|
Triggers when the selected item changed. The callback parameter list is `(value: Array)` and `value` is the value array of the selected items.
|
|
|
|
^^^
|
2020-12-22 16:33:30 +08:00
|
|
|
|
|
|
|
### Icons
|
|
|
|
|
|
|
|
| Name | Description |
|
|
|
|
| -- | -- |
|
2021-10-20 01:11:27 +08:00
|
|
|
| ``check`` | The loading spinner. |
|