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/packages/svelte/tests/runtime-runes/samples/derived-state-init/Component.svelte

13 lines
214 B

<script>
let { arr } = $props();
let local_arr = $derived($state(arr));
</script>
<button onclick={()=>{
local_arr.push(local_arr.length + 1);
}}>push</button>
{#each local_arr as item}
<p>{item}</p>
{/each}