Form
CascadeSelect
A select for nested options, one column per level, opening each group beside the last.
WAI-ARIA tested
Import
main.ts
import { CascadeSelect } from '@vitral/vue';Basic
Value: null
Uneven depth
Sizes and states
API
Read from packages/vue/src/components/CascadeSelect/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| options | any[] | The top level; groups hold the next level in one of `optionGroupChildren`. |
| optionLabel | string | Field (dotted path) holding a choosable option's text. |
| optionValue | string | Field holding the value v-model receives. Without it, the whole option is the value. |
| optionDisabled | string | — |
| optionGroupLabel | string | Field holding a group's text. |
| optionGroupChildren | string | string[] | The field, or the fields, one per level, that hold a group's children. Defaults to `items`. |
| dataKey | string | Compare object values by this field instead of structurally. |
| placeholder | string | — |
| showClear | boolean | — |
| loading | boolean | — |
| emptyMessage | string | — |
| disabled | boolean | — |
| invalid | boolean | — |
| size | Size | — |
| variant | InputVariant | — |
| fluid | boolean | — |
| placement | OverlayPlacement | — |
| appendTo | string | `'body'` (the default), `'self'` to render in place, or a selector. |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Emits
| Event | Payload | Description |
|---|---|---|
| change | event: { originalEvent?: Event; value: unknown } | — |
| group-change | event: { originalEvent?: Event; value: unknown } | — |
| show | — | — |
| hide | — | — |
| focus | event: FocusEvent | — |
| blur | event: FocusEvent | — |
Slots
| Name | Slot props | Description |
|---|---|---|
| value | (props: { value: unknown; option: unknown; placeholder?: string }) | — |
| option | (props: { option: unknown; level: number; group: boolean; selected: boolean; focused: boolean }) | — |
| empty | — | — |
| dropdownicon | (props: { open: boolean }) | — |
| optiongroupicon | — | — |