fragment.rs 533 B

12345678910111213141516171819202122232425
  1. //! Basic example that renders a simple VNode to the browser.
  2. use dioxus_core::prelude::*;
  3. use dioxus_web::*;
  4. fn main() {
  5. // Setup logging
  6. wasm_logger::init(wasm_logger::Config::new(log::Level::Debug));
  7. console_error_panic_hook::set_once();
  8. // Run the app
  9. wasm_bindgen_futures::spawn_local(WebsysRenderer::start(App));
  10. }
  11. static App: FC<()> = |cx| {
  12. cx.render(rsx! {
  13. h2 { "abc 1" }
  14. div {
  15. "hello world!"
  16. }
  17. Fragment {
  18. h2 { "abc 2"}
  19. }
  20. })
  21. };