diff --git a/packages/api-generator/src/locale/en/VDataTable.json b/packages/api-generator/src/locale/en/VDataTable.json index d3ba7c6c350..42e640fb0f0 100644 --- a/packages/api-generator/src/locale/en/VDataTable.json +++ b/packages/api-generator/src/locale/en/VDataTable.json @@ -61,6 +61,7 @@ "item.data-table-select": "Slot to replace the default `v-checkbox-btn` used when selecting rows.", "item.data-table-expand": "Slot to replace the default `v-icon` used when expanding rows.", "item.": "Slot to customize a specific column.", + "item.prepend": "Slot to add content before each row.", "loading": "Defines content for when `loading` is true and no items are provided.", "tbody": "Slot to replace the default table ``.", "thead": "Slot to replace the default table ``.", diff --git a/packages/api-generator/src/locale/en/VDataTableRows.json b/packages/api-generator/src/locale/en/VDataTableRows.json index cdc7d8c0ee1..176d119225e 100644 --- a/packages/api-generator/src/locale/en/VDataTableRows.json +++ b/packages/api-generator/src/locale/en/VDataTableRows.json @@ -21,6 +21,7 @@ "group-summary": "Slot for custom rendering of a group summary.", "item.data-table-expand": "Slot for custom rendering of a row cell with the expand icon.", "item.data-table-select": "Slot for custom rendering of a row cell with the select checkbox.", + "item.prepend": "Slot to add content before each row.", "loading": "Slot for custom rendering of the loading state." } } diff --git a/packages/vuetify/src/components/VDataTable/VDataTableRows.tsx b/packages/vuetify/src/components/VDataTable/VDataTableRows.tsx index d4333db1693..d2b3a3ea969 100644 --- a/packages/vuetify/src/components/VDataTable/VDataTableRows.tsx +++ b/packages/vuetify/src/components/VDataTable/VDataTableRows.tsx @@ -29,6 +29,7 @@ export type VDataTableRowsSlots = VDataTableGroupHeaderRowSlots & VDataTableR 'group-summary': GroupSummarySlot 'no-data': never 'expanded-row': ItemSlot + 'item.prepend': ItemSlot } export const makeVDataTableRowsProps = propsFactory({ @@ -180,6 +181,8 @@ export const VDataTableRows = genericComponent( return ( + { slots['item.prepend']?.(slotProps) } + { slots.item ? slots.item(itemSlotProps) : (