mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-27 14:40:44 +00:00
26 lines
569 B
Rust
26 lines
569 B
Rust
//! Basic example that renders a simple VNode to the browser.
|
|
|
|
use dioxus_core::prelude::*;
|
|
use dioxus_html as dioxus_elements;
|
|
use dioxus_web::*;
|
|
|
|
fn main() {
|
|
// Setup logging
|
|
wasm_logger::init(wasm_logger::Config::new(log::Level::Debug));
|
|
console_error_panic_hook::set_once();
|
|
|
|
// Run the app
|
|
wasm_bindgen_futures::spawn_local(WebsysRenderer::start(App));
|
|
}
|
|
|
|
static App: FC<()> = |cx| {
|
|
cx.render(rsx! {
|
|
h2 { "abc 1" }
|
|
div {
|
|
"hello world!"
|
|
}
|
|
Fragment {
|
|
h2 { "abc 2"}
|
|
}
|
|
})
|
|
};
|