dioxus/examples/readme.rs

15 lines
258 B
Rust
Raw Normal View History

use dioxus::prelude::*;
2021-12-30 02:28:28 +00:00
2021-07-06 16:13:00 +00:00
fn main() {
2024-01-20 08:11:55 +00:00
launch(app);
2021-07-06 16:13:00 +00:00
}
fn app() -> Element {
2024-01-14 05:12:21 +00:00
let mut count = use_signal(|| 0);
2021-07-06 16:13:00 +00:00
2024-01-16 19:18:46 +00:00
rsx! {
2022-03-05 22:07:34 +00:00
button { onclick: move |_| count += 1, "Up high!" }
button { onclick: move |_| count -= 1, "Down low!" }
2024-01-14 05:12:21 +00:00
}
}