|
|
@ -12,12 +12,20 @@
|
|
|
|
function clear() {
|
|
|
|
function clear() {
|
|
|
|
todos = todos.filter(t => !t.done);
|
|
|
|
todos = todos.filter(t => !t.done);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$: remaining = todos.filter(t => !t.done).length;
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
|
|
|
.done {
|
|
|
|
|
|
|
|
opacity: 0.4;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|
|
<h1>Todos</h1>
|
|
|
|
<h1>Todos</h1>
|
|
|
|
|
|
|
|
|
|
|
|
{#each todos as todo}
|
|
|
|
{#each todos as todo}
|
|
|
|
<div>
|
|
|
|
<div class:done={todo.done}>
|
|
|
|
<input
|
|
|
|
<input
|
|
|
|
type=checkbox
|
|
|
|
type=checkbox
|
|
|
|
bind:checked={todo.done}
|
|
|
|
bind:checked={todo.done}
|
|
|
@ -30,6 +38,8 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/each}
|
|
|
|
{/each}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p>{remaining} remaining</p>
|
|
|
|
|
|
|
|
|
|
|
|
<button on:click={add}>
|
|
|
|
<button on:click={add}>
|
|
|
|
Add new
|
|
|
|
Add new
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|