Data
OrderList
A list the reader puts in order, with buttons, the keyboard or drag and drop.
WAI-ARIA tested
Import
main.ts
import { OrderList } from '@vitral/vue';Basic
Trip order
- São PauloBrazil
- LisboaPortugal
- LuandaAngola
- MaputoMozambique
- PraiaCabo Verde
- DiliTimor-Leste
API
Read from packages/vue/src/components/OrderList/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| optionLabel | string | Field (dotted path) holding an item's text, for the default template and the announcements. |
| dataKey | string | A field that identifies an item. |
| header | string | The list's title; it names the list. Without one, name it with `aria-label`. |
| dragdrop | boolean | Let items be dragged to a new place. Defaults to true. |
| showControls | boolean | Show the move buttons. Defaults to true. |
| scrollHeight | string | The list's height. |
| disabled | boolean | — |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Emits
| Event | Payload | Description |
|---|---|---|
| reorder | event: { originalEvent?: Event; value: unknown[]; direction: 'up' | 'down' | 'top' | 'bottom' | 'drop' } | — |
Slots
| Name | Slot props | Description |
|---|---|---|
| option | (props: { item: unknown; index: number; selected: boolean }) | An item's content. |
| header | — | Replaces the title. |