mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-12-25 20:13:09 +00:00
29 lines
603 B
Rust
29 lines
603 B
Rust
|
use dioxus_core as dioxus;
|
||
|
use dioxus_core::prelude::*;
|
||
|
use dioxus_web::WebsysRenderer;
|
||
|
|
||
|
fn main() {
|
||
|
wasm_logger::init(wasm_logger::Config::new(log::Level::Debug));
|
||
|
console_error_panic_hook::set_once();
|
||
|
|
||
|
log::info!("hello world");
|
||
|
wasm_bindgen_futures::spawn_local(WebsysRenderer::start(JonsFavoriteCustomApp));
|
||
|
}
|
||
|
|
||
|
fn JonsFavoriteCustomApp(cx: Context<()>) -> VNode {
|
||
|
let items = (0..20).map(|f| {
|
||
|
rsx! {
|
||
|
li {"{f}"}
|
||
|
}
|
||
|
});
|
||
|
|
||
|
cx.render(rsx! {
|
||
|
div {
|
||
|
"list"
|
||
|
ul {
|
||
|
{items}
|
||
|
}
|
||
|
}
|
||
|
})
|
||
|
}
|