dioxus/docs/router/examples/catch_all_segments.rs

25 lines
588 B
Rust
Raw Normal View History

2023-06-01 22:31:13 +00:00
#![allow(non_snake_case, unused)]
use dioxus::prelude::*;
use dioxus_router::prelude::*;
// ANCHOR: route
#[derive(Routable, Clone)]
#[rustfmt::skip]
enum Route {
// segments that start with :... are catch all segments
2023-07-18 23:34:27 +00:00
#[route("/blog/:..segments")]
2023-06-01 22:31:13 +00:00
BlogPost {
// You must include catch all segment in child variants
segments: Vec<String>,
},
}
// Components must contain the same catch all segments as their corresponding variant
#[inline_props]
fn BlogPost(cx: Scope, segments: Vec<String>) -> Element {
todo!()
}
// ANCHOR_END: route
fn main() {}