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/binding-indirect/main.svelte

19 lines
383 B

<script>
export let selected;
export let tasks;
</script>
<select bind:value={selected}>
{#each tasks as task}
<option value='{task}'>{task.description}</option>
{/each}
</select>
<label>
<input type='checkbox' bind:checked={selected.done}> {selected.description}
</label>
<h2>Pending tasks</h2>
{#each tasks.filter(t => !t.done) as task}
<p>{task.description}</p>
{/each}