Function silkenweb::router::link_clicked

source ·
pub fn link_clicked(
    path: impl Into<String>
) -> impl FnMut(MouseEvent, HtmlAnchorElement) + 'static
Expand description

An on_click handler for routed <a> elements.

This will correctly deal with modifier keys. See also: anchor.

Example

let path = "/my_path";
let link: A = a().href(path).text("click me").on_click(link_clicked(path));