mirror of https://github.com/sveltejs/svelte
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.
17 lines
255 B
17 lines
255 B
4 years ago
|
<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}
|