1
0

listy.rs 639 B

1234567891011121314151617181920212223242526272829
  1. use dioxus_core as dioxus;
  2. use dioxus_core::prelude::*;
  3. use dioxus_html as dioxus_elements;
  4. use dioxus_web::WebsysRenderer;
  5. fn main() {
  6. wasm_logger::init(wasm_logger::Config::new(log::Level::Debug));
  7. console_error_panic_hook::set_once();
  8. log::info!("hello world");
  9. wasm_bindgen_futures::spawn_local(WebsysRenderer::start(JonsFavoriteCustomApp));
  10. }
  11. fn JonsFavoriteCustomApp(cx: Context<()>) -> VNode {
  12. let items = (0..20).map(|f| {
  13. rsx! {
  14. li {"{f}"}
  15. }
  16. });
  17. cx.render(rsx! {
  18. div {
  19. "list"
  20. ul {
  21. {items}
  22. }
  23. }
  24. })
  25. }