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-block-pro.../main.svelte

17 lines
255 B

<script>
import { tick } from 'svelte';
let refs = [];
export function addItem() {
refs = refs.concat({ ref: null });
return tick();
}
export let callback;
$: callback(refs);
</script>
{#each refs as xxx}
<div bind:this={xxx.ref} />
{/each}