perf(data-table): only render table row content when expanded (#1211)

Closes #1209
This commit is contained in:
metonym 2022-03-25 06:49:58 -07:00 committed by GitHub
commit 051a8702e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -497,6 +497,7 @@
parentRowId = null; parentRowId = null;
}}" }}"
> >
{#if expandedRows[row.id] && !nonExpandableRowIds.includes(row.id)}
<TableCell <TableCell
colspan="{selectable ? headers.length + 2 : headers.length + 1}" colspan="{selectable ? headers.length + 2 : headers.length + 1}"
> >
@ -504,6 +505,7 @@
<slot name="expanded-row" row="{row}" /> <slot name="expanded-row" row="{row}" />
</div> </div>
</TableCell> </TableCell>
{/if}
</tr> </tr>
{/if} {/if}
{/each} {/each}