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/if-block-else-update/main.svelte

21 lines
298 B

<script>
let foo = false
let bar = [false];
</script>
<button on:click={() => foo = !foo}>
Toggle foo
</button>
<button on:click={() => bar[0] = !bar[0]}>
Toggle bar
</button>
<hr>
{@html `foo: ${foo}, bar: ${bar.every(x => x)}`}
<hr>
{#if foo}
foo!
{:else if bar.every(x => x)}
bar!
{/if}