From 30bc06726985636602a7e9c42f0802c06dfe4e05 Mon Sep 17 00:00:00 2001 From: Alexander Trost Date: Sun, 7 Apr 2024 13:45:33 +0200 Subject: [PATCH] feat(Table): add rowClass to columns list This allows the columns list to specify a class to be set on the rows columns. Signed-off-by: Alexander Trost --- docs/content/2.components/table.md | 1 + src/runtime/components/data/Table.vue | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/content/2.components/table.md b/docs/content/2.components/table.md index f747feff2..34e21e3cd 100644 --- a/docs/content/2.components/table.md +++ b/docs/content/2.components/table.md @@ -29,6 +29,7 @@ Use the `columns` prop to configure which columns to display. It's an array of o - `sortable` - Whether the column is sortable. Defaults to `false`. - `direction` - The sort direction to use on first click. Defaults to `asc`. - `class` - The class to apply to the column cells. +- `rowClass` - The class to apply to the data column cells. - `sort` - Pass your own `sort` function. Defaults to a simple _greater than_ / _less than_ comparison. ::component-example{class="grid"} diff --git a/src/runtime/components/data/Table.vue b/src/runtime/components/data/Table.vue index e85c0ecbc..9fc69aa8d 100644 --- a/src/runtime/components/data/Table.vue +++ b/src/runtime/components/data/Table.vue @@ -66,7 +66,7 @@ - + {{ getRowData(row, column.key) }} @@ -119,6 +119,7 @@ interface Column { sort?: (a: any, b: any, direction: 'asc' | 'desc') => number direction?: 'asc' | 'desc' class?: string + rowClass?: string [key: string]: any }