* create static site generation helpers in the router crate * work on integrating static site generation into fullstack * move ssg into a separate crate * integrate ssg with the launch builder * simplify ssg example * fix static_routes for child routes * move CLI hot reloading websocket code into dioxus-hot-reload * fix some unused imports * use the same hot reloading websocket code for fullstack * fix fullstack hot reloading * move cli hot reloading logic into the hot reload crate * ssg example working with dx serve * add more examples * fix clippy * fix formatting * fix hot reload doctest imports * fix axum imports * don't run server doc tests * Fix hot reload websocket doc examples
54 lines
993 B
Rust
54 lines
993 B
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 {
|
|
todo!()
|
|
}
|
|
|
|
#[component]
|
|
fn Root() -> Element {
|
|
todo!()
|
|
}
|
|
|
|
#[component]
|
|
fn ChildRoot() -> Element {
|
|
todo!()
|
|
}
|
|
|
|
#[component]
|
|
fn NotStatic(not_static: String) -> Element {
|
|
todo!()
|
|
}
|
|
|
|
assert_eq!(
|
|
Route::static_routes(),
|
|
vec![
|
|
Route::Root {},
|
|
Route::Test {},
|
|
Route::Nested {
|
|
child: ChildRoute::ChildRoot {}
|
|
},
|
|
],
|
|
);
|
|
}
|