fix(data-table): use headers key as id

Fixes #1062
This commit is contained in:
Eric Liu 2022-02-08 18:35:00 -08:00
commit 0cb93d57da

View file

@ -136,7 +136,7 @@
const headerItems = writable([]); const headerItems = writable([]);
const thKeys = derived(headerItems, () => const thKeys = derived(headerItems, () =>
headers headers
.map(({ key }, i) => ({ key, id: $headerItems[i] })) .map(({ key }, i) => ({ 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) =>