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/lifecycle-onmount-infinite-.../main.svelte

17 lines
246 B

<script>
import { onMount } from 'svelte';
import Child from './Child.svelte';
let root;
export let count = 0;
onMount(() => {
if (count < 5) {
count++;
new Child({ target: root });
}
});
</script>
<div bind:this={root}></div>