useOptions
DataTable
stable
Aggregates DataTable state (page, itemsPerPage, sortBy, groupBy, search) into a single reactive options object and emits update:options whenever any of those refs change. Also resets the page to 1 automatically when the search term changes. Used internally by OrigamDataTable.
API
Signature
Signature TypeScript complète extraite du fichier du composable.
Interfaces consommées
IDataTableSortItem
API
Paramètres
Paramètres d'entrée acceptés par ce composable.
- pagerequisRef<number>
- Current page index (1-based). Automatically reset to 1 when the search term changes.
- itemsPerPagerequisRef<number>
- Number of rows per page. -1 disables pagination (all rows visible).
- sortByrequisRef<Array<IDataTableSortItem>>
- Active sort descriptors: array of { key, order } objects.
- groupByrequisRef<Array<IDataTableSortItem>>
- Active group-by descriptors. Empty array = no grouping.
- searchrequisRef<string | undefined>
- Current search string. Changing this value triggers a page reset and an immediate update:options emit.
Usage
Exemples
Extraits de code prêts à coller.
Listen to DataTable option changes
Server-side data with reactive options