huge improvedments

This commit is contained in:
2024-11-25 22:15:32 +01:00
parent 0266c26d34
commit 6d86e8a42b
11 changed files with 82 additions and 217 deletions
+2 -12
View File
@@ -3,24 +3,14 @@ use crate::prelude::*;
pub fn examples() -> Element {
rsx! {
styling: Some(styling()),
button { class: "btn", on_click: Handler::new(|btn: &mut Button, _, document| {
let data = document.get_element_by_id::<DataHolder<'_, String>>("my_data").unwrap();
data.data += "!";
btn.children.set_text(&data.data);
}), "Hello, World!" }
{
let mut data = dataholder::<String>();
data.id = "my_data";
data
}
button { class: "btn", "Hello, World!" }
}
}
pub fn styling() -> Css {
css! {
.btn {
x: 30%,
x: Center,
y: Auto,
color: Red,
}