mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
example: fix so we remove by ID, not by id-as-index
This commit is contained in:
parent
f3f685c923
commit
5ab865e89d
1 changed files with 2 additions and 5 deletions
|
@ -154,17 +154,14 @@ fn TodoRow(
|
|||
|
||||
<button on:click=move |_| {
|
||||
let id = todo.id().get();
|
||||
store
|
||||
.todos()
|
||||
.update(|todos| {
|
||||
todos.remove(id);
|
||||
});
|
||||
store.todos().write().retain(|todo| todo.id != id);
|
||||
}>"X"</button>
|
||||
<input
|
||||
type="date"
|
||||
prop:value=move || {
|
||||
todo.status().scheduled_for_date().map(|n| n.get().to_string())
|
||||
}
|
||||
|
||||
class:hidden=move || !todo.status().scheduled_for()
|
||||
on:change:target=move |ev| {
|
||||
if let Some(date) = todo.status().scheduled_for_date() {
|
||||
|
|
Loading…
Reference in a new issue