Skip to content

VTable API Documentation

Display the API documentation for the VTable component.

Models

Supports bidirectional binding, used to control the internal state of the table

Model NameDescriptionTypeDefault Value
defaultFilterFilter stateVTableColumnFiltersState[]
defaultSortSort stateVTableSortingState[]
defaultPaginationPagination stateVTablePaginationState{}
defaultExpandedExpanded stateVTableExpandedState[]
defaultSelectionSelection stateVTableSelectionState[]
defaultColumnPinningColumn pinning stateVTableColumnPinningState{}
defaultColumnSizingColumn sizing stateVTableColumnSizingState{}

Props

Property NameDescriptionTypeDefault Value
dataTable data sourceTData[][]
columnsTable column configurationVTableColumn[][]
rowHeightTable row height (recommended to set, optimize scrolling performance)number-
rowKeyRow unique identifier field or functionstring | number | (row: TData) => string or number-
loadingWhether the table is in loading statebooleanfalse
fixedHeaderWhether to fix the table headerbooleantrue
enableSortingRemovalWhether to allow sorting removalbooleantrue
borderedWhether to display bordersbooleanfalse
rowSelectionConfigRow selection configurationVTableRowSelectionConfig<TData>See description
loadMoreConfigLoad more configurationVTableLoadMoreConfigSee description
paginationConfigPagination configurationVTablePaginationConfigSee description
treeConfigTree structure configurationVTableTreeConfigSee description
enableExpandRowWhether to enable expandable rowsbooleanfalse
enableRowHoverWhether to enable row hover highlightingbooleantrue
adaptiveColumnWidthMinimum column width for adaptive column widthnumber120
defaultExpandAllRowsWhether to expand all rows by default (only initialized)booleanfalse
columnResizeModeColumn width adjustment mode'onChange' | 'onEnd''onChange'
fixedFooterWhether to fix the table footerbooleanfalse
themeConfigCustom theme configuration (can override default theme)VTableThemeConfig{}
defaultCheckboxColumnWidthDefault checkbox column widthnumber40
defaultExpandColumnWidthDefault expanded column widthnumber42
customRowAttributesCustom data row attributes(row, rowIndex) => HTMLAttributes() => ({})
customHeaderCellAttributesCustom table header cell attributes(column, colIndex) => ThHTMLAttributes() => ({})
customCellAttributesCustom table body cell attributes (supports merging cells)(row, column, rowIndex, colIndex) => TdHTMLAttributes or null() => ({})
layoutModeTable layout mode (fixed width / content fit)'fixed' | 'contentFit''fixed'

Events

Event NameDescriptionCallback Parameters
onTableChangeTriggered when the table state changes (pagination, sorting, filtering)(state: VTableChangeState) => void
onScrollToBottomTriggered when scrolling to the bottom() => void
onExpandedRowsChangeTriggered when the expanded rows change(state: VTableExpandedState) => void
onColumnSizingChangeTriggered when the column width changes(state: VTableColumnSizingState) => void
onExpandTriggered when the expand icon is clicked(expanded: boolean, row: TData) => void

Slots

Slot NameDescriptionParameters
customHeaderCustom the entire table header{ columns, table }
bodyCellCustom cell content{ columnKey, column, row, rowIndex }
headerCellCustom table header cell{ columnKey, column }
customFilterIconCustom filter icon{ columnKey, filtered, column }
customFilterDropdownCustom filter dropdown{ confirm, reset, setFilterValue, column, filterModelValue }
expandedRowRenderCustom expanded row content{ row }
customPopoverCustom Popover{ open, onOpenChange, trigger, content }
customPaginationCustom pagination component{ pageSize, pageIndex, total, onPageChange }
customCheckboxCustom checkbox{ checked, disabled, indeterminate, onCheckedChange }
customEmptyCustom empty state-
customLoadingIconCustom loading icon-
customLoadNoMoreCustom load more hint-
customFooterCustom table footer-
customExpandIconCustom expand icon{ expand, onExpandChange }
customSorterIconCustom sort icon{ sort }

Methods

Call the component instance method through ref

Method NameDescriptionParametersReturn Value
scrollToIndexScroll to the specified row index(index: number, behavior?: ScrollBehavior)void
tanstackTableGet TanStack Table instance-Table
setEditingRowSet the current editing row`(rowId: stringnumber

Last updated: