it almost lives?
This commit is contained in:
1 parent
d637ef187c
commit
5f0dd3af3e
43 files changed
+506
-244
No files matched your search
@@ -17,7 +17,7 @@ enum Route {
|
||||
#[inline_props]
|
||||
fn App(cx: Scope) -> Element {
|
||||
render! {
|
||||
Router {}
|
||||
Router::<Route> {}
|
||||
}
|
||||
}
|
||||
// ANCHOR_END: app
|
||||
|
||||
@@ -35,7 +35,7 @@ enum Route {
|
||||
|
||||
fn App(cx: Scope) -> Element {
|
||||
render! {
|
||||
Router {}
|
||||
Router::<Route> {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ fn NavBar(cx: Scope) -> Element {
|
||||
li { Link { to: Route::BlogList {}, "Blog" } }
|
||||
}
|
||||
}
|
||||
Outlet {}
|
||||
Outlet::<Route> {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ fn Home(cx: Scope) -> Element {
|
||||
fn Blog(cx: Scope) -> Element {
|
||||
render! {
|
||||
h1 { "Blog" }
|
||||
Outlet {}
|
||||
Outlet::<Route> {}
|
||||
}
|
||||
}
|
||||
// ANCHOR_END: blog
|
||||
|
||||
@@ -20,7 +20,7 @@ fn main() {}
|
||||
fn GoToDioxus(cx: Scope) -> Element {
|
||||
render! {
|
||||
Link {
|
||||
to: NavigationTarget::External("https://dioxuslabs.com".into()),
|
||||
to: "https://dioxuslabs.com",
|
||||
"ExternalTarget target"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ enum Route {
|
||||
#[inline_props]
|
||||
fn App(cx: Scope) -> Element {
|
||||
render! {
|
||||
Router {}
|
||||
Router::<Route> {}
|
||||
}
|
||||
}
|
||||
// ANCHOR_END: app
|
||||
|
||||
@@ -39,7 +39,7 @@ enum Route {
|
||||
|
||||
fn App(cx: Scope) -> Element {
|
||||
render! {
|
||||
Router {}
|
||||
Router::<Route> {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ fn NavBar(cx: Scope) -> Element {
|
||||
li { Link { to: Route::BlogList {}, "Blog" } }
|
||||
}
|
||||
}
|
||||
Outlet {}
|
||||
Outlet::<Route> {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ fn Home(cx: Scope) -> Element {
|
||||
fn Blog(cx: Scope) -> Element {
|
||||
render! {
|
||||
h1 { "Blog" }
|
||||
Outlet {}
|
||||
Outlet::<Route> {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ enum Route {
|
||||
#[inline_props]
|
||||
fn App(cx: Scope) -> Element {
|
||||
render! {
|
||||
Router {
|
||||
Router::<Route> {
|
||||
config: || RouterConfig::default().history(WebHistory::default())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ fn NavBar(cx: Scope) -> Element {
|
||||
}
|
||||
}
|
||||
}
|
||||
Outlet {}
|
||||
Outlet::<Route> {}
|
||||
}
|
||||
}
|
||||
// ANCHOR_END: nav
|
||||
@@ -41,7 +41,7 @@ fn NavBar(cx: Scope) -> Element {
|
||||
#[inline_props]
|
||||
fn App(cx: Scope) -> Element {
|
||||
render! {
|
||||
Router {}
|
||||
Router::<Route> {}
|
||||
}
|
||||
}
|
||||
// ANCHOR_END: app
|
||||
|
||||
@@ -14,7 +14,7 @@ enum Route {
|
||||
#[inline_props]
|
||||
fn App(cx: Scope) -> Element {
|
||||
render! {
|
||||
Router {}
|
||||
Router::<Route> {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ fn NavBar(cx: Scope) -> Element {
|
||||
}
|
||||
}
|
||||
// The Outlet component will render child routes (In this case just the Home component) inside the Outlet component
|
||||
Outlet {}
|
||||
Outlet::<Route> {}
|
||||
}
|
||||
}
|
||||
// ANCHOR_END: nav
|
||||
@@ -35,7 +35,7 @@ fn NavBar(cx: Scope) -> Element {
|
||||
#[inline_props]
|
||||
fn App(cx: Scope) -> Element {
|
||||
render! {
|
||||
Router {}
|
||||
Router::<Route> {}
|
||||
}
|
||||
}
|
||||
// ANCHOR_END: app
|
||||
|
||||
@@ -16,7 +16,7 @@ fn Wrapper(cx: Scope) -> Element {
|
||||
render! {
|
||||
header { "header" }
|
||||
// The index route will be rendered here
|
||||
Outlet { }
|
||||
Outlet::<Route> { }
|
||||
footer { "footer" }
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ fn Index(cx: Scope) -> Element {
|
||||
|
||||
fn App(cx: Scope) -> Element {
|
||||
render! {
|
||||
Router {}
|
||||
Router::<Route> {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ enum Route {
|
||||
#[inline_props]
|
||||
fn App(cx: Scope) -> Element {
|
||||
render! {
|
||||
Router {
|
||||
Router::<Route> {
|
||||
config: || RouterConfig::default().history(WebHistory::default())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ fn Index(cx: Scope) -> Element {
|
||||
|
||||
fn app(cx: Scope) -> Element {
|
||||
render! {
|
||||
Router {
|
||||
Router::<Route> {
|
||||
config: || RouterConfig::default().on_update(|state|{
|
||||
(state.current() == Route::Index {}).then_some(
|
||||
NavigationTarget::Internal(Route::Home {})
|
||||
|
||||
Reference in new issue
Block a user