mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-10 06:34:20 +00:00
remove duplicate blog in the router example
This commit is contained in:
parent
ad01a45f3b
commit
341bc7f6a1
2 changed files with 5 additions and 3 deletions
|
@ -5,7 +5,7 @@ fn main() {
|
|||
launch_desktop(Route::Home {});
|
||||
}
|
||||
|
||||
#[derive(Routable, Clone)]
|
||||
#[derive(Routable, Clone, Debug, PartialEq)]
|
||||
#[rustfmt::skip]
|
||||
enum Route {
|
||||
#[layout(NavBar)]
|
||||
|
@ -15,7 +15,7 @@ enum Route {
|
|||
#[layout(Blog)]
|
||||
#[route("/")]
|
||||
BlogList {},
|
||||
#[route("/blog/:name")]
|
||||
#[route("/:name")]
|
||||
BlogPost { name: String },
|
||||
#[end_layout]
|
||||
#[end_nest]
|
||||
|
@ -49,11 +49,13 @@ fn NavBar() -> Element {
|
|||
|
||||
#[component]
|
||||
fn Home() -> Element {
|
||||
println!("Home");
|
||||
rsx! { h1 { "Welcome to the Dioxus Blog!" } }
|
||||
}
|
||||
|
||||
#[component]
|
||||
fn Blog() -> Element {
|
||||
println!("Blog");
|
||||
rsx! {
|
||||
h1 { "Blog" }
|
||||
Outlet::<Route> {}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use dioxus_lib::prelude::{consume_context, try_consume_context, use_hook};
|
||||
use dioxus_lib::prelude::{try_consume_context, use_hook};
|
||||
|
||||
use crate::prelude::{Navigator, RouterContext};
|
||||
|
||||
|
|
Loading…
Reference in a new issue