mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-12-26 04:23:08 +00:00
30 lines
494 B
Rust
30 lines
494 B
Rust
|
#![allow(non_snake_case)]
|
||
|
use dioxus::prelude::*;
|
||
|
use dioxus_router::prelude::*;
|
||
|
|
||
|
#[derive(Routable, Clone)]
|
||
|
enum Route {
|
||
|
#[route("/")]
|
||
|
Home {},
|
||
|
}
|
||
|
|
||
|
// ANCHOR: app
|
||
|
#[inline_props]
|
||
|
fn App(cx: Scope) -> Element {
|
||
|
render! {
|
||
|
Router {
|
||
|
config: || RouterConfig::default().history(WebHistory::default())
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
// ANCHOR_END: app
|
||
|
|
||
|
#[inline_props]
|
||
|
fn Home(cx: Scope) -> Element {
|
||
|
render! {
|
||
|
h1 { "Welcome to the Dioxus Blog!" }
|
||
|
}
|
||
|
}
|
||
|
|
||
|
fn main() {}
|