feat(data-table): make title, description slottable #720 (#722)

Closes #720
This commit is contained in:
Eric Liu 2021-07-05 08:44:07 -07:00 committed by GitHub
commit 5fee13b2eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 91 additions and 1 deletions

View file

@ -202,7 +202,19 @@
}
</script>
<TableContainer title="{title}" description="{description}" {...$$restProps}>
<TableContainer {...$$restProps}>
<div class:bx--data-table-header="{true}">
{#if title || $$slots.title}
<h4 class:bx--data-table-header__title="{true}">
<slot name="title">{title}</slot>
</h4>
{/if}
{#if description || $$slots.description}
<p class:bx--data-table-header__description="{true}">
<slot name="description">{description}</slot>
</p>
{/if}
</div>
<slot />
<Table
zebra="{zebra}"