refactor(data-table): remove unused indices

This commit is contained in:
Eric Liu 2022-06-05 13:35:53 -07:00
commit 4b8130befd

View file

@ -148,7 +148,7 @@
const tableRows = writable(rows); const tableRows = writable(rows);
const thKeys = derived(headerItems, () => const thKeys = derived(headerItems, () =>
headers headers
.map(({ key }, i) => ({ key, id: key })) .map(({ key }) => ({ key, id: key }))
.reduce((a, c) => ({ ...a, [c.key]: c.id }), {}) .reduce((a, c) => ({ ...a, [c.key]: c.id }), {})
); );
const resolvePath = (object, path) => { const resolvePath = (object, path) => {
@ -339,7 +339,7 @@
/> />
</th> </th>
{/if} {/if}
{#each headers as header, i (header.key)} {#each headers as header (header.key)}
{#if header.empty} {#if header.empty}
<th scope="col" style="{formatHeaderWidth(header)}"></th> <th scope="col" style="{formatHeaderWidth(header)}"></th>
{:else} {:else}