mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-23 04:33:06 +00:00
53 lines
1 KiB
Rust
53 lines
1 KiB
Rust
use dioxus::prelude::*;
|
|
|
|
#[test]
|
|
fn with_class() {
|
|
#[derive(Routable, Clone, PartialEq, Debug)]
|
|
enum ChildRoute {
|
|
#[route("/")]
|
|
ChildRoot {},
|
|
#[route("/:not_static")]
|
|
NotStatic { not_static: String },
|
|
}
|
|
|
|
#[derive(Routable, Clone, PartialEq, Debug)]
|
|
enum Route {
|
|
#[route("/")]
|
|
Root {},
|
|
#[route("/test")]
|
|
Test {},
|
|
#[child("/child")]
|
|
Nested { child: ChildRoute },
|
|
}
|
|
|
|
#[component]
|
|
fn Test() -> Element {
|
|
unimplemented!()
|
|
}
|
|
|
|
#[component]
|
|
fn Root() -> Element {
|
|
unimplemented!()
|
|
}
|
|
|
|
#[component]
|
|
fn ChildRoot() -> Element {
|
|
unimplemented!()
|
|
}
|
|
|
|
#[component]
|
|
fn NotStatic(not_static: String) -> Element {
|
|
unimplemented!()
|
|
}
|
|
|
|
assert_eq!(
|
|
Route::static_routes(),
|
|
vec![
|
|
Route::Root {},
|
|
Route::Test {},
|
|
Route::Nested {
|
|
child: ChildRoute::ChildRoot {}
|
|
},
|
|
],
|
|
);
|
|
}
|