catch_all_segments.rs 588 B

123456789101112131415161718192021222324
  1. #![allow(non_snake_case, unused)]
  2. use dioxus::prelude::*;
  3. use dioxus_router::prelude::*;
  4. // ANCHOR: route
  5. #[derive(Routable, Clone)]
  6. #[rustfmt::skip]
  7. enum Route {
  8. // segments that start with :... are catch all segments
  9. #[route("/blog/:..segments")]
  10. BlogPost {
  11. // You must include catch all segment in child variants
  12. segments: Vec<String>,
  13. },
  14. }
  15. // Components must contain the same catch all segments as their corresponding variant
  16. #[inline_props]
  17. fn BlogPost(cx: Scope, segments: Vec<String>) -> Element {
  18. todo!()
  19. }
  20. // ANCHOR_END: route
  21. fn main() {}