Skip to content
On this page

Reference

Props

PropTypeDefaultDescription
itemsArray[]The array of items to be displayed in the table. Each item represents a row.
fieldsArray[]An optional array that specifies the fields in the items to be displayed as columns. If not provided, all fields in the items will be displayed.
alignObject{}An optional object that specifies the alignment for each field. It can take 'left', 'center', or 'right'. If not provided, the default alignment is 'left'.
titleObject{}An optional object that specifies the title for each field. If not provided, the field names will be used as titles.
orderableArray[]An optional array that specifies which fields can be ordered. If not provided, no fields can be ordered.
orderByArray[]An optional array that specifies the initial ordering of the items. It should be a two-element array, with the first element being the field name, and the second element being either 'asc' for ascending order, or 'desc' for descending order. If not provided, the items are not ordered.
selectableBooleanfalseAn optional boolean that specifies whether the items are selectable. If true, a checkbox will be displayed next to each item, and the selected items can be retrieved with the update:selected event.
selectedArray[]An optional array that specifies which items are initially selected. It should be an array of item IDs. If not provided, no items are initially selected.
sortableBooleanfalseAn optional boolean that specifies whether the items can be sorted by dragging and dropping. If true, a handle will be displayed next to each item, and the new order can be retrieved with the sort event.
mapTitlesFunctionundefinedAn optional function that transforms the titles of the fields. It takes a field name as input and should return a string.

Events

EventParametersDescription
clickNoneFired when a row in the table is clicked.
sortArrayFired when the items are sorted. It returns an array of the items in the new order.
update:selectedArrayFired when the selected items are changed. It returns an array of the IDs of the selected items.
update:orderByArrayFired when the ordering of the items is changed. It returns a two-element array, with the first element being the field name, and the second element being either 'asc' for ascending order, or 'desc' for descending order.

Slots

SlotPropsDescription
[K in TFields[number]]{item: Type}A slot for customizing the content of a specific field in the table. The slot's name should match the field's name, and it receives the corresponding item as a prop.