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/snippet-const/main.svelte

11 lines
188 B

<script>
let count = $state(0);
</script>
{#snippet counter()}
{@const doubled = count * 2}
<button on:click={() => (count += 1)}>{doubled}</button>
{/snippet}
{@render counter()}