This commit is contained in:
2024-11-24 20:00:29 +01:00
parent e463ca1e7c
commit 33843688d8
8 changed files with 228 additions and 72 deletions
+16 -5
View File
@@ -2,10 +2,21 @@ use crate::prelude::*;
pub fn event_logger() -> Element {
rsx! {
id: "root",
text { on_event: Handler::new(|_, _, document| {
let root = document.get_element_by_id::<Div>("root").unwrap();
root.children.add_child(rsx_elem!( text { "Ok" } ));
}), id: "txt", "current event: None" }
styling: Some(styling()),
button { class: "txt", "Hello, World!" }
}
}
pub fn styling() -> Css {
css! {
.txt {
x: Center,
y: Center,
color: Red,
}
.txt: clicked {
color: Blue,
}
}
}