mirror of https://github.com/sveltejs/svelte
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.
19 lines
411 B
19 lines
411 B
6 years ago
|
---
|
||
|
title: Each block bindings
|
||
|
---
|
||
|
|
||
|
You can even bind to properties inside an `each` block.
|
||
|
|
||
|
```html
|
||
|
<input
|
||
|
type=checkbox
|
||
|
bind:checked={todo.done}
|
||
|
>
|
||
|
|
||
|
<input
|
||
|
placeholder="What needs to be done?"
|
||
|
bind:value={todo.text}
|
||
|
>
|
||
|
```
|
||
|
|
||
|
> Note that interacting with these `<input>` elements will mutate the array. If you prefer to work with immutable data, you should avoid these bindings and use event handlers instead.
|