Make new enum router less breaking

This commit is contained in:
Evan Almloff committed 2023-07-24 11:57:56 -07:00
1 parent b51ffa0590
commit 61dc549ba1
16 files changed
+74 -63

No files matched your search

+5 -5
View File
@@ -39,12 +39,12 @@ fn Route1(cx: Scope, user_id: usize, dynamic: usize, query: String, extra: Strin
"Route1{{\n\tuser_id:{user_id},\n\tdynamic:{dynamic},\n\tquery:{query},\n\textra:{extra}\n}}"
}
Link {
target: Route::Route1 { user_id: *user_id, dynamic: *dynamic, query: String::new(), extra: extra.clone() + "." },
to: Route::Route1 { user_id: *user_id, dynamic: *dynamic, query: String::new(), extra: extra.clone() + "." },
"Route1 with extra+\".\""
}
p { "Footer" }
Link {
target: Route::Route3 { dynamic: String::new() },
to: Route::Route3 { dynamic: String::new() },
"Home"
}
}
@@ -59,7 +59,7 @@ fn Route2(cx: Scope, user_id: usize) -> Element {
(0..*user_id).map(|i| rsx!{ p { "{i}" } }),
p { "Footer" }
Link {
target: Route::Route3 { dynamic: String::new() },
to: Route::Route3 { dynamic: String::new() },
"Home"
}
}
@@ -86,7 +86,7 @@ fn Route3(cx: Scope, dynamic: String) -> Element {
}
"dynamic: {dynamic}"
Link {
target: Route::Route2 { user_id: 8888 },
to: Route::Route2 { user_id: 8888 },
"hello world link"
}
button {
@@ -101,7 +101,7 @@ fn Route3(cx: Scope, dynamic: String) -> Element {
if route != current_route {
render! {
Link {
target: route.clone(),
to: route.clone(),
"{route}"
}
}