testbed.rs 444 B

12345678910111213141516171819202122232425262728
  1. use dioxus::prelude::*;
  2. fn main() {
  3. env_logger::init();
  4. dioxus::desktop::launch(Example, |c| c);
  5. }
  6. const STYLE: &str = r#"
  7. body {background-color: powderblue;}
  8. h1 {color: blue;}
  9. p {color: red;}
  10. "#;
  11. const Example: FC<()> = |cx| {
  12. cx.render(rsx! {
  13. Child { }
  14. Child { }
  15. })
  16. };
  17. const Child: FC<()> = |cx| {
  18. cx.render(rsx!(
  19. h1 {"1" }
  20. h1 {"2" }
  21. h1 {"3" }
  22. h1 {"4" }
  23. ))
  24. };