Skip to content

Commit

Permalink
feat(Table): add getRowId prop
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmaxlogiudice committed Jan 23, 2025
1 parent 1b989c4 commit 8189869
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/runtime/components/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import type { Ref } from 'vue'
import type { VariantProps } from 'tailwind-variants'
import type { AppConfig } from '@nuxt/schema'
import type { RowData } from '@tanstack/table-core'
import type { CoreOptions, RowData } from '@tanstack/table-core'
import type {
Row,
ColumnDef,
Expand Down Expand Up @@ -103,6 +103,11 @@ export interface TableProps<T> {
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection)
*/
rowSelectionOptions?: Omit<RowSelectionOptions<T>, 'onRowSelectionChange'>
/**
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getrowid)
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables)
*/
getRowId?: CoreOptions<T>['getRowId']
class?: any
ui?: Partial<typeof table.slots>
}
Expand Down Expand Up @@ -169,6 +174,7 @@ const tableApi = useVueTable({
...(props.expandedOptions || {}),
getExpandedRowModel: getExpandedRowModel(),
onExpandedChange: updaterOrValue => valueUpdater(updaterOrValue, expandedState),
getRowId: props.getRowId,
state: {
get globalFilter() {
return globalFilterState.value
Expand Down

0 comments on commit 8189869

Please sign in to comment.