mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-12-19 09:03:13 +00:00
29 lines
493 B
Rust
29 lines
493 B
Rust
|
#![allow(non_snake_case)]
|
||
|
use dioxus::prelude::*;
|
||
|
use dioxus_router::prelude::*;
|
||
|
|
||
|
// ANCHOR: route
|
||
|
#[derive(Routable, Clone)]
|
||
|
#[rustfmt::skip]
|
||
|
enum Route {
|
||
|
// Routes always start with a slash
|
||
|
#[route("/")]
|
||
|
Home {},
|
||
|
// You can have multiple segments in a route
|
||
|
#[route("/hello/world")]
|
||
|
HelloWorld {},
|
||
|
}
|
||
|
|
||
|
#[inline_props]
|
||
|
fn Home(cx: Scope) -> Element {
|
||
|
todo!()
|
||
|
}
|
||
|
|
||
|
#[inline_props]
|
||
|
fn HelloWorld(cx: Scope) -> Element {
|
||
|
todo!()
|
||
|
}
|
||
|
// ANCHOR_END: route
|
||
|
|
||
|
|
||
|
fn main() {}
|