Update examples, add css
This commit is contained in:
57 files changed
+964
-595
No files matched your search
@@ -1,3 +1,7 @@
|
||||
//! A simple demonstration of how to set attributes on buttons to disable them.
|
||||
//!
|
||||
//! This example also showcases the shorthand syntax for attributes, and how signals themselves implement IntoAttribute
|
||||
|
||||
use dioxus::prelude::*;
|
||||
|
||||
fn main() {
|
||||
@@ -8,13 +12,12 @@ fn app() -> Element {
|
||||
let mut disabled = use_signal(|| false);
|
||||
|
||||
rsx! {
|
||||
div {
|
||||
div { style: "text-align: center; margin: 20px; display: flex; flex-direction: column; align-items: center;",
|
||||
button { onclick: move |_| disabled.toggle(),
|
||||
"click to "
|
||||
if disabled() { "enable" } else { "disable" }
|
||||
" the lower button"
|
||||
}
|
||||
|
||||
button { disabled, "lower button" }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user