diff --git a/packages/vuetify/src/components/VDataTable/VDataTable.tsx b/packages/vuetify/src/components/VDataTable/VDataTable.tsx index 4a7402407bc..8b2daa23a79 100644 --- a/packages/vuetify/src/components/VDataTable/VDataTable.tsx +++ b/packages/vuetify/src/components/VDataTable/VDataTable.tsx @@ -24,9 +24,9 @@ import { computed, toRef } from 'vue' import { genericComponent, propsFactory, useRender } from '@/util' // Types -import type { UnwrapRef } from 'vue' +import type { DeepReadonly, UnwrapRef } from 'vue' import type { Group } from './composables/group' -import type { CellProps, DataTableItem, InternalDataTableHeader, RowProps } from './types' +import type { CellProps, DataTableHeader, DataTableItem, InternalDataTableHeader, RowProps } from './types' import type { VDataTableHeadersSlots } from './VDataTableHeaders' import type { VDataTableRowsSlots } from './VDataTableRows' import type { GenericProps, SelectItemKey } from '@/util' @@ -101,6 +101,7 @@ export const VDataTable = genericComponent( rowProps?: RowProps> cellProps?: CellProps> itemSelectable?: SelectItemKey> + headers?: DeepReadonly>[]> modelValue?: V 'onUpdate:modelValue'?: (value: V) => void }, diff --git a/packages/vuetify/src/components/VDataTable/types.ts b/packages/vuetify/src/components/VDataTable/types.ts index 3bb5a61a54d..1faee9aafd9 100644 --- a/packages/vuetify/src/components/VDataTable/types.ts +++ b/packages/vuetify/src/components/VDataTable/types.ts @@ -7,9 +7,9 @@ import type { SelectItemKey } from '@/util' export type DataTableCompareFunction = (a: T, b: T) => number -export type DataTableHeader = { +export type DataTableHeader> = { key?: 'data-table-group' | 'data-table-select' | 'data-table-expand' | (string & {}) - value?: SelectItemKey + value?: SelectItemKey title?: string fixed?: boolean @@ -26,7 +26,7 @@ export type DataTableHeader = { sort?: DataTableCompareFunction filter?: FilterFunction - children?: DataTableHeader[] + children?: DataTableHeader[] } export type InternalDataTableHeader = Omit & {