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/each-block-keyed-component-.../main.svelte

18 lines
271 B

<script>
import Component from "./Component.svelte";
export let arr = [];
export let count = 0;
function action(node, params) {
count += 1;
return {
destroy() {
count -= 1;
}
};
}
</script>
{#each arr as item (item)}
<Component {action} />
{/each}