impl ComponentFunction for Routes

This commit is contained in:
Evan Almloff committed 2024-01-16 09:40:17 -06:00
1 parent 7e4d2debe0
commit d2cdcc602b
9 files changed
+154 -106

No files matched your search

+22 -4
View File
@@ -29,14 +29,32 @@ fn Blog(id: String) -> Element {
fn Nav() -> Element {
render! {
nav {
li { Link { to: Route::Homepage { }, "Go home" } }
li { Link { to: Route::Blog { id: "Brownies".to_string() }, "Learn Brownies" } }
li { Link { to: Route::Blog { id: "Cookies".to_string() }, "Learn Cookies" } }
li {
Link { to: Route::Homepage {}, "Go home" }
}
li {
Link {
to: Route::Blog {
id: "Brownies".to_string(),
},
"Learn Brownies"
}
}
li {
Link {
to: Route::Blog {
id: "Cookies".to_string(),
},
"Learn Cookies"
}
}
}
div { Outlet::<Route> {} }
}
}
fn main() {
launch(|| render!(Router::<Route> {}));
launch(Route::Blog {
id: "hello".to_string(),
});
}