mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
feat(Table): add empty prop
This commit is contained in:
@@ -75,6 +75,11 @@ export interface TableProps<T extends TableData> extends TableOptions<T> {
|
||||
data?: T[]
|
||||
columns?: TableColumn<T>[]
|
||||
caption?: string
|
||||
/**
|
||||
* The text to display when the table is empty.
|
||||
* @defaultValue t('table.noData')
|
||||
*/
|
||||
empty?: string
|
||||
/**
|
||||
* Whether the table should have a sticky header.
|
||||
* @defaultValue false
|
||||
@@ -369,7 +374,7 @@ defineExpose({
|
||||
<tr v-else>
|
||||
<td :colspan="columns?.length" :class="ui.empty({ class: props.ui?.empty })">
|
||||
<slot name="empty">
|
||||
{{ t('table.noData') }}
|
||||
{{ empty || t('table.noData') }}
|
||||
</slot>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user