createDataTable API
API reference for the createDataTable composable.
Related
Explore these related pages for additional context and usage patterns.
| Page | Category |
|---|---|
| createDataTable | Data |
| createFilter | Data |
| createPagination | Data |
| createVirtual | Data |
Functions
createDataTable
(options: DataTableOptions<T>) => DataTableContext<T>Creates a data table instance with sort controls, selection, and an adapter-driven data pipeline. Must be called inside a component `setup()` or a Vue effect scope. Calling at module scope in SSR environments causes request state leakage.
createDataTableContext
(_options: DataTableContextOptions<T>) => ContextTrinity<DataTableContext<T>>Creates a data table context with dependency injection support.
useDataTable
(namespace?: string) => DataTableContext<T>Returns the current data table context from dependency injection.
Options
itemValue
KeysOfType<T, ID> | undefinedProperty used as row identifier. Must resolve to a string or number value.
Default: 'id'
pagination
Omit<PaginationOptions, "size"> | undefinedPagination options (size derived from pipeline)
selectStrategy
SelectStrategy | undefinedSelection strategy: 'single' selects one row, 'page' operates on visible items, 'all' operates on all filtered items.
Default: 'page'
locale
string | undefinedLocale for sorting (defaults to useLocale's selected locale or browser default)
Properties
grouping
DataTableGrouping<T>Row grouping controls. When groupBy is not set, `groups` returns an empty array.