hello.rs 885 B

123456789101112131415161718192021222324252627282930313233
  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. dioxus_web::intern_cache();
  10. wasm_bindgen_futures::spawn_local(WebsysRenderer::start(Example));
  11. }
  12. pub static Example: FC<()> = |cx, props| {
  13. let nodes = (0..500).map(|f| rsx! (li {"div"}));
  14. cx.render(rsx! {
  15. div {
  16. span {
  17. class: "px-2 py-1 flex w-36 mt-4 items-center text-xs rounded-md font-semibold text-yellow-500 bg-yellow-100"
  18. "DUE DATE : 189 JUN"
  19. }
  20. p {
  21. "these"
  22. "are"
  23. "text"
  24. "nodes"
  25. }
  26. {nodes}
  27. }
  28. })
  29. };