feat(Table): allow providing a <caption> (#1680)

This commit is contained in:
Neil Richter
2024-04-16 16:39:52 +02:00
committed by GitHub
parent 4853520eb3
commit 3fca66857d
4 changed files with 86 additions and 0 deletions

View File

@@ -1,6 +1,11 @@
<template>
<div :class="ui.wrapper" v-bind="attrs">
<table :class="[ui.base, ui.divide]">
<slot v-if="$slots.caption || caption" name="caption">
<caption :class="ui.caption">
{{ caption }}
</caption>
</slot>
<thead :class="ui.thead">
<tr :class="ui.tr.base">
<th v-if="modelValue" scope="col" :class="ui.checkbox.padding">
@@ -183,6 +188,10 @@ export default defineComponent({
type: Object as PropType<{ icon: string, label: string }>,
default: () => config.default.emptyState
},
caption: {
type: String,
default: null
},
progress: {
type: Object as PropType<{ color: ProgressColor, animation: ProgressAnimation }>,
default: () => config.default.progress