From 80dfa88ea442571ee1dc673317cc7baa8cacd8a3 Mon Sep 17 00:00:00 2001 From: andr35 <9112303+andr35@users.noreply.github.com> Date: Tue, 22 Apr 2025 21:14:57 +0200 Subject: [PATCH] feat(Table): conditionally apply classes to `tr` and `td` (#3866) Co-authored-by: Benjamin Canac --- docs/content/3.components/table.md | 7 +++++ src/runtime/components/Table.vue | 41 +++++++++++++++++++++++++----- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/docs/content/3.components/table.md b/docs/content/3.components/table.md index 01d16047..5a5c01de 100644 --- a/docs/content/3.components/table.md +++ b/docs/content/3.components/table.md @@ -105,6 +105,13 @@ highlights: When rendering components with `h`, you can either use the `resolveComponent` function or import from `#components`. :: +### Meta + +Use the `meta` prop as an object ([TableMeta](https://tanstack.com/table/latest/docs/api/core/table#meta)) to pass properties like: + +- `class`: + - `tr`: [The classes to apply to the `tr` element.]{class="text-muted"} + ### Loading Use the `loading` prop to display a loading state, the `loading-color` prop to change its color and the `loading-animation` prop to change its animation. diff --git a/src/runtime/components/Table.vue b/src/runtime/components/Table.vue index 69528589..c3a29e30 100644 --- a/src/runtime/components/Table.vue +++ b/src/runtime/components/Table.vue @@ -2,7 +2,7 @@