1
0

flat_router.rs 961 B

12345678910111213141516171819202122232425262728293031323334353637
  1. use dioxus::desktop::tao::dpi::LogicalSize;
  2. use dioxus::prelude::*;
  3. fn main() {
  4. env_logger::init();
  5. dioxus::desktop::launch_cfg(app, |c| {
  6. c.with_window(|c| {
  7. c.with_title("Spinsense Client")
  8. .with_inner_size(LogicalSize::new(600, 1000))
  9. .with_resizable(false)
  10. })
  11. })
  12. }
  13. fn app(cx: Scope) -> Element {
  14. cx.render(rsx! {
  15. Router {
  16. Route { to: "/", "Home" }
  17. Route { to: "/games", "Games" }
  18. Route { to: "/play", "Play" }
  19. Route { to: "/settings", "Settings" }
  20. p {
  21. "----"
  22. }
  23. nav {
  24. ul {
  25. Link { to: "/", li { "Home" } }
  26. Link { to: "/games", li { "Games" } }
  27. Link { to: "/play", li { "Play" } }
  28. Link { to: "/settings", li { "Settings" } }
  29. }
  30. }
  31. }
  32. })
  33. }