mirror of
https://github.com/sveltejs/svelte.git
synced 2024-11-30 00:46:29 +01:00
Simplify each block bindings example (#5094)
No need for CSS here, the same effect could be achieved with just a `disabled` binding.
This commit is contained in:
parent
fc7e99e9f0
commit
5c6730e382
@ -16,16 +16,10 @@
|
||||
$: remaining = todos.filter(t => !t.done).length;
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.done {
|
||||
opacity: 0.4;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h1>Todos</h1>
|
||||
|
||||
{#each todos as todo}
|
||||
<div class:done={todo.done}>
|
||||
<div>
|
||||
<input
|
||||
type=checkbox
|
||||
bind:checked={todo.done}
|
||||
@ -34,6 +28,7 @@
|
||||
<input
|
||||
placeholder="What needs to be done?"
|
||||
bind:value={todo.text}
|
||||
disabled={todo.done}
|
||||
>
|
||||
</div>
|
||||
{/each}
|
||||
|
Loading…
Reference in New Issue
Block a user