dioxus/examples/link.rs

29 lines
631 B
Rust
Raw Normal View History

2022-01-18 01:19:12 +00:00
use dioxus::prelude::*;
fn main() {
dioxus::desktop::launch(app);
}
fn app(cx: Scope) -> Element {
cx.render(rsx! (
2022-01-18 01:20:36 +00:00
div {
2022-01-18 01:19:12 +00:00
p {
a {
href: "http://dioxuslabs.com/",
"default link"
}
}
p {
a {
href: "http://dioxuslabs.com/",
2022-01-18 06:52:14 +00:00
prevent_default: "onclick",
2022-01-18 01:19:12 +00:00
onclick: |_| {
println!("Hello Dioxus");
},
"custom event link",
}
}
}
))
}