static_segments.rs 493 B

12345678910111213141516171819202122232425262728
  1. #![allow(non_snake_case)]
  2. use dioxus::prelude::*;
  3. use dioxus_router::prelude::*;
  4. // ANCHOR: route
  5. #[derive(Routable, Clone)]
  6. #[rustfmt::skip]
  7. enum Route {
  8. // Routes always start with a slash
  9. #[route("/")]
  10. Home {},
  11. // You can have multiple segments in a route
  12. #[route("/hello/world")]
  13. HelloWorld {},
  14. }
  15. #[inline_props]
  16. fn Home(cx: Scope) -> Element {
  17. todo!()
  18. }
  19. #[inline_props]
  20. fn HelloWorld(cx: Scope) -> Element {
  21. todo!()
  22. }
  23. // ANCHOR_END: route
  24. fn main() {}