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