mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-12-11 21:32:27 +00:00
22 lines
468 B
Rust
22 lines
468 B
Rust
use dioxus::prelude::*;
|
|
|
|
fn main() {
|
|
dioxus_desktop::launch(app);
|
|
}
|
|
|
|
fn app(cx: Scope) -> Element {
|
|
let login = use_callback!(cx, || move |evt: MouseEvent| async move {
|
|
let res = reqwest::get("https://dog.ceo/api/breeds/list/all")
|
|
.await
|
|
.unwrap()
|
|
.text()
|
|
.await
|
|
.unwrap();
|
|
|
|
println!("{}, ", res);
|
|
});
|
|
|
|
cx.render(rsx! {
|
|
button { onclick: login, "Click me!" }
|
|
})
|
|
}
|