Column

Demos

See the demos of Table.

API

Props

NameTypeDefaultDescription
titlestring-The column title.
fieldstring-The field name as a key of items in the data prop of the parent Table component.
widthstring=|number=-The column width in px value.
sortableboolean=false

Whether current column is sortable.

alignstring=-The alignment of cell content in the column. Supports left / center / right.
spanfunction(number): Object=

A function that defines how cells should span across rows/columns. The type is function(index: number): { row: number, col: number }, where index being the index of current row inside the data prop of the parent Table. The row / col of the return value correspond to table cell's rowspan / colspan attribut, with a default value of 1.

descstring-The description of the column head.
filter-value*-

.sync

The value of current filter condition. null means not filtered. When filter-multiple is true, the value is an array of selected values.

filter-multipleboolean=falseWhether the built-in filter is multi-select or not.
filter-optionsArray<Object>-The list of filter options, with items of type {label, value, options, disabled, ...}, see the options prop of the Select component.
filter-titlestring=-The title of the filter dropdown.
allowed-ordersArray[false, 'desc', 'asc'][^allowed-orders]
tooltipboolean | ((item: Object) => string)-Whether to automatically show tooltips when content overflows. The tooltip displays the field corresponding to the field prop of the [data](. /table#props-data) prop of Table component the current column belongs to. When being a function, the item argument is the entire data item and the returned string will be displayed as tooltip content.

Slots

NameDescription
headThe table head.
foot

The table foot.

default

The content of the table cell. Displays the property value corresponds to the field prop in table's data prop.

The slot scope properties are the same as each item inside data, with an extra index: number, which denotes the index within the row data.

sub-row

The content of cells in a sub row. Sub row data comes from the children array inside the row data in Tables data prop. The number of sub rows are determined by the length of the children array and the sub rows share the same column configuration with the table.

Displays the value keyed by the field prop inside the sub row data, which is data[i].children[j] of the parent table.

The slot scope properties are the same as each item inside children, with an extra index: number, which denotes the index within the row data.

desc

The content of the description overlay. Will override the desc prop when set.

NameTypeDescription
closefunction(): voidUsed to close the description overlay.
filter

The content of the filter dropdown.

NameTypeDescription
closefunction(): voidUsed to close the filter dropdown.
Edit this page on GitHubEdit