2022-01-08 07:10:47 +00:00
|
|
|
use dioxus::prelude::*;
|
|
|
|
|
|
|
|
fn main() {
|
2022-07-09 19:15:20 +00:00
|
|
|
dioxus_desktop::launch(app);
|
2022-01-08 07:10:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn app(cx: Scope) -> Element {
|
2022-03-01 07:50:03 +00:00
|
|
|
let disabled = use_state(&cx, || false);
|
2022-01-08 07:10:47 +00:00
|
|
|
|
|
|
|
cx.render(rsx! {
|
|
|
|
div {
|
|
|
|
button {
|
2022-03-01 07:50:03 +00:00
|
|
|
onclick: move |_| disabled.set(!disabled),
|
|
|
|
"click to "
|
2022-09-13 21:57:23 +00:00
|
|
|
if disabled == true { "enable" } else { "disable" }
|
2022-03-01 07:50:03 +00:00
|
|
|
" the lower button"
|
2022-01-08 07:10:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
button {
|
|
|
|
disabled: "{disabled}",
|
|
|
|
"lower button"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|