We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d685f4 commit 3d90a26Copy full SHA for 3d90a26
examples/disabled.rs
@@ -0,0 +1,23 @@
1
+use dioxus::prelude::*;
2
+
3
+fn main() {
4
+ dioxus::desktop::launch(app);
5
+}
6
7
+fn app(cx: Scope) -> Element {
8
+ let disabled = use_state(&cx, || false);
9
10
+ cx.render(rsx! {
11
+ div {
12
+ button {
13
+ onclick: move |_| disabled.set(!disabled.get()),
14
+ "click to " [if *disabled {"enable"} else {"disable"} ] " the lower button"
15
+ }
16
17
18
+ disabled: "{disabled}",
19
+ "lower button"
20
21
22
+ })
23
0 commit comments