Update examples, add css

This commit is contained in:
Jonathan Kelley committed 2024-02-14 12:33:07 -08:00
1 parent 25d103c1a5
commit bdbae8ccb0
57 files changed
+964 -595

No files matched your search

+11
View File
@@ -99,6 +99,10 @@ pub struct LinkProps {
/// The onclick event handler.
pub onclick: Option<EventHandler<MouseEvent>>,
/// The onmounted event handler.
/// Fired when the <a> element is mounted.
pub onmounted: Option<EventHandler<MountedEvent>>,
#[props(default)]
/// Whether the default behavior should be executed if an `onclick` handler is provided.
///
@@ -269,10 +273,17 @@ pub fn Link(props: LinkProps) -> Element {
}
};
let onmounted = move |event| {
if let Some(handler) = props.onmounted.clone() {
handler.call(event);
}
};
rsx! {
a {
onclick: action,
href,
onmounted: onmounted,
prevent_default,
class,
rel,