From 5dffa868b11760610ea0bf9f2ce37931cdac4eb9 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Thu, 29 Jun 2023 17:42:34 +0200 Subject: [PATCH] feat(Table): allow columns `class` customization Resolves #366 --- docs/content/4.data/1.table.md | 1 + src/runtime/components/data/Table.vue | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/content/4.data/1.table.md b/docs/content/4.data/1.table.md index 00cfd741..7dda7a17 100644 --- a/docs/content/4.data/1.table.md +++ b/docs/content/4.data/1.table.md @@ -72,6 +72,7 @@ Use the `columns` prop to configure which columns to display. It's an array of o - `key` - The field to display from the row data. - `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. ::component-example{class="grid"} --- diff --git a/src/runtime/components/data/Table.vue b/src/runtime/components/data/Table.vue index 97bae03a..e1391508 100644 --- a/src/runtime/components/data/Table.vue +++ b/src/runtime/components/data/Table.vue @@ -7,7 +7,7 @@ - + [] }, columns: { - type: Array as PropType<{ key: string, sortable?: boolean, [key: string]: any }[]>, + type: Array as PropType<{ key: string, sortable?: boolean, class?: string, [key: string]: any }[]>, default: null }, columnAttribute: {