Последняя активность 1729152893

Версия 1cf792b3124de10e816afaa89802eba64d39e24d

Dioxus-5.rs Исходник
1fn Counters() -> Element {
2 let mut counters = use_signal(|| vec![0; 10]);
3
4 rsx! {
5 button { onclick: move |_| counters.push(counters.len()), "Add Counter" }
6 ul {
7 for idx in 0..counters.len() {
8 li {
9 button { onclick: move |_| counters.write()[idx] += 1, "{counters.index(idx)}" }
10 button { onclick: move |_| { counters.remove(idx); }, "Remove" }
11 }
12 }
13 }
14 }
15}