chore(Table): handle empty-state

Resolves #243
This commit is contained in:
Benjamin Canac
2023-05-31 18:30:49 +02:00
parent 8bdb8c45f7
commit 2966373a86
5 changed files with 78 additions and 3 deletions

View File

@@ -33,6 +33,17 @@
</slot>
</td>
</tr>
<tr v-if="emptyState && !rows.length">
<td :colspan="columns.length">
<div :class="ui.emptyState.wrapper">
<UIcon v-if="emptyState.icon" :name="emptyState.icon" :class="ui.emptyState.icon" aria-hidden="true" />
<p :class="ui.emptyState.label">
{{ emptyState.label }}
</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
@@ -93,6 +104,10 @@ export default defineComponent({
type: String,
default: () => appConfig.ui.table.default.sortDescIcon
},
emptyState: {
type: Object as PropType<{ icon: string, label: string }>,
default: () => appConfig.ui.table.default.emptyState
},
ui: {
type: Object as PropType<Partial<typeof appConfig.ui.table>>,
default: () => appConfig.ui.table