VEUI

VEUI on GitHub
Play!中文

OptionGroup

Examples

See Select examples or Dropdown examples.

API

Props

NameTypeDefaultDescription
labelstring-The title of the option group.
expandedbooleanfalseWhether the option list is expanded.
trigger'click' | 'hover''click'When to expand the option list.
optionsArray<Object>[]

The option list, with each item having the structure {label, value, disabled, ...}.

NameTypeDescription
labelstringThe text description of the option.
value*The value corresponding to the option.
disabledbooleanWhether the option is disabled.
positionstringinline

The way the internal options are displayed.

ValueDescription
inlineDisplay directly in-line.
popupDisplay in a popup layer.
overlay-classstring | Array | Object-Refers to the overlay-class prop of the Overlay component.
overlay-stylestring | Array | Object-Refers to the overlay-style prop of the Overlay component.

Slots

NameDescription
defaultThe content of the option list. When the options prop is not specified, it can be used to directly inline Option or other OptionGroup components.
label

The text area of the option group title.

Default content: The text corresponding to the label prop.

NameTypeDescription
labelstringThe text of the option group title.
disabledbooleanWhether the option group is disabled.
group-label

The text area of the title of the sub-option group.

Default content: The value of the label property of the option corresponding to options.

NameTypeDescription
labelstringThe text of the option group.
disabledbooleanWhether the option group is disabled.

In addition, other properties in the current option group data will also be automatically bound to slot props through v-bind except for the properties described above.

option-label

The text area of the option.

Default content: The label property value of the option without options.

NameTypeDescription
labelstringThe text of the option.
valuestringThe value of the option.
selectedbooleanWhether it is already selected.
disabledbooleanWhether the option is disabled.

In addition, other properties in the current option data will also be automatically bound to slot props through v-bind except for the properties described above.

option

The entire area of the selectable option.

Default content: The default structure of the component inside Option.

NameTypeDescription
labelstringThe text of the option.
valuestringThe value of the option.
selectedbooleanWhether it is already selected.
disabledbooleanWhether the option is disabled.

In addition, other properties in the current option data will also be automatically bound to slot props through v-bind except for the properties described above.

beforeThe pre-area of the option list.
afterThe post-area of the option list.
### Events

| Name | Description |
| -- | -- |
| ``toggle`` | Triggered when the option list is expanded or collapsed, with the callback parameter `(expanded: boolean)`. `expanded` indicates whether the operation will expand or collapse the option list. |
| ``afteropen`` | Triggered after the option list is opened. |

### Icons

| Name | Description |
| -- | -- |
| ``expandable`` | Expandable item. |

### CSS

| Name | Type | Default | Description |
| -- | -- | -- | -- |
| ``--dls-dropdown-max-display-items`` | `<integer>` | `8` | [^css-max-display-items] |

^^^css-max-display-items
When the [`position`](#props-position) prop is set to `popup`, it specifies the maximum number of items that can be displayed at the same time in the dropdown list, and the maximum height of the dropdown box will be calculated based on this.

:::tip
It needs to be set through the [`overlay-style`](#props-overlay-style) prop.
:::
^^^
Edit this page on GitHubEdit
© Baidu, Inc. 2024