diff --git a/docs/components/content/examples/TableExampleExpandable.vue b/docs/components/content/examples/TableExampleExpandable.vue new file mode 100644 index 0000000000..90f1adf239 --- /dev/null +++ b/docs/components/content/examples/TableExampleExpandable.vue @@ -0,0 +1,49 @@ + + + diff --git a/docs/content/2.components/table.md b/docs/content/2.components/table.md index 117e953000..fa9776d98e 100644 --- a/docs/content/2.components/table.md +++ b/docs/content/2.components/table.md @@ -301,6 +301,19 @@ componentProps: --- :: +### Expandable :u-badge{label="New" class="align-middle ml-2 !rounded-full" variant="subtle"} + +You can use the `expand` slot to display extra information about a row. You will have access to the `row` property in the slot scope. + +::component-example{class="grid"} +--- +padding: false +component: 'table-example-expandable' +componentProps: + class: 'flex-1' +--- +:: + ### Loading Use the `loading` prop to indicate that data is currently loading with an indeterminate [Progress](/components/progress#indeterminate) bar. diff --git a/src/runtime/components/data/Table.vue b/src/runtime/components/data/Table.vue index 093643fb3c..6be9c4a7ab 100644 --- a/src/runtime/components/data/Table.vue +++ b/src/runtime/components/data/Table.vue @@ -12,6 +12,10 @@ + + Expand + + @@ -84,7 +110,7 @@