You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/runtime/samples/binding-this-each-object-props/main.svelte

14 lines
286 B

<script>
export const items1 = {};
export const items2 = {};
export let data = [
{id: 1, text: "b"},
{id: 2, text: "c"},
];
</script>
{#each data as item (item.id)}
<div bind:this={items1[item.id]}>{item.text}</div>
<div bind:this={items2[item.id]}>{item.text}</div>
{/each}