From 3fca66857d3616bf24a1b0579c90179a7883869d Mon Sep 17 00:00:00 2001 From: Neil Richter Date: Tue, 16 Apr 2024 16:39:52 +0200 Subject: [PATCH] feat(Table): allow providing a `` (#1680) --- .../examples/TableExampleCaptionSlot.vue | 63 +++++++++++++++++++ docs/content/2.components/table.md | 13 ++++ src/runtime/components/data/Table.vue | 9 +++ src/runtime/ui.config/data/table.ts | 1 + 4 files changed, 86 insertions(+) create mode 100644 docs/components/content/examples/TableExampleCaptionSlot.vue diff --git a/docs/components/content/examples/TableExampleCaptionSlot.vue b/docs/components/content/examples/TableExampleCaptionSlot.vue new file mode 100644 index 00000000..ead85e4c --- /dev/null +++ b/docs/components/content/examples/TableExampleCaptionSlot.vue @@ -0,0 +1,63 @@ + + + diff --git a/docs/content/2.components/table.md b/docs/content/2.components/table.md index f747feff..63068175 100644 --- a/docs/content/2.components/table.md +++ b/docs/content/2.components/table.md @@ -450,6 +450,19 @@ componentProps: --- :: +### `caption` + +Use the `#caption` slot to customize the table's caption. + +::component-example +--- +padding: false +component: 'table-example-caption-slot' +componentProps: + class: 'flex-1' +--- +:: + ## Props :component-props diff --git a/src/runtime/components/data/Table.vue b/src/runtime/components/data/Table.vue index e85c0ecb..08b6eb9b 100644 --- a/src/runtime/components/data/Table.vue +++ b/src/runtime/components/data/Table.vue @@ -1,6 +1,11 @@