Make new enum router less breaking
This commit is contained in:
1 parent
b51ffa0590
commit
61dc549ba1
16 files changed
+74
-63
No files matched your search
@@ -44,8 +44,8 @@ fn NavBar(cx: Scope) -> Element {
|
||||
render! {
|
||||
nav {
|
||||
ul {
|
||||
li { Link { target: Route::Home {}, "Home" } }
|
||||
li { Link { target: Route::BlogList {}, "Blog" } }
|
||||
li { Link { to: Route::Home {}, "Home" } }
|
||||
li { Link { to: Route::BlogList {}, "Blog" } }
|
||||
}
|
||||
}
|
||||
Outlet {}
|
||||
@@ -77,13 +77,13 @@ fn BlogList(cx: Scope) -> Element {
|
||||
ul {
|
||||
li {
|
||||
Link {
|
||||
target: Route::BlogPost { name: "Blog post 1".into() },
|
||||
to: Route::BlogPost { name: "Blog post 1".into() },
|
||||
"Read the first blog post"
|
||||
}
|
||||
}
|
||||
li {
|
||||
Link {
|
||||
target: Route::BlogPost { name: "Blog post 2".into() },
|
||||
to: Route::BlogPost { name: "Blog post 2".into() },
|
||||
"Read the second blog post"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ fn main() {}
|
||||
fn GoToDioxus(cx: Scope) -> Element {
|
||||
render! {
|
||||
Link {
|
||||
target: NavigationTarget::External("https://dioxuslabs.com".into()),
|
||||
to: NavigationTarget::External("https://dioxuslabs.com".into()),
|
||||
"ExternalTarget target"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,8 +48,8 @@ fn NavBar(cx: Scope) -> Element {
|
||||
render! {
|
||||
nav {
|
||||
ul {
|
||||
li { Link { target: Route::Home {}, "Home" } }
|
||||
li { Link { target: Route::BlogList {}, "Blog" } }
|
||||
li { Link { to: Route::Home {}, "Home" } }
|
||||
li { Link { to: Route::BlogList {}, "Blog" } }
|
||||
}
|
||||
}
|
||||
Outlet {}
|
||||
@@ -78,13 +78,13 @@ fn BlogList(cx: Scope) -> Element {
|
||||
ul {
|
||||
li {
|
||||
Link {
|
||||
target: Route::BlogPost { name: "Blog post 1".into() },
|
||||
to: Route::BlogPost { name: "Blog post 1".into() },
|
||||
"Read the first blog post"
|
||||
}
|
||||
}
|
||||
li {
|
||||
Link {
|
||||
target: Route::BlogPost { name: "Blog post 2".into() },
|
||||
to: Route::BlogPost { name: "Blog post 2".into() },
|
||||
"Read the second blog post"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ fn NavBar(cx: Scope) -> Element {
|
||||
Link {
|
||||
// The Link component will navigate to the route specified
|
||||
// in the target prop which is checked to exist at compile time
|
||||
target: Route::Home {},
|
||||
to: Route::Home {},
|
||||
"Home"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user