mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-21 23:40:39 +01:00
feat(Table): allow providing a <caption> (#1680)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -4,6 +4,7 @@ export default {
|
||||
divide: 'divide-y divide-gray-300 dark:divide-gray-700',
|
||||
thead: 'relative',
|
||||
tbody: 'divide-y divide-gray-200 dark:divide-gray-800',
|
||||
caption: 'sr-only',
|
||||
tr: {
|
||||
base: '',
|
||||
selected: 'bg-gray-50 dark:bg-gray-800/50',
|
||||
|
||||
Reference in New Issue
Block a user