fragment.rs 579 B

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