simple_list.rs 466 B

12345678910111213141516171819
  1. use dioxus::prelude::*;
  2. fn main() {
  3. dioxus_desktop::launch(app);
  4. }
  5. fn app(cx: Scope) -> Element {
  6. cx.render(rsx!(
  7. // Use Map directly to lazily pull elements
  8. (0..10).map(|f| rsx! { "{f}" }),
  9. // Collect into an intermediate collection if necessary
  10. ["a", "b", "c"]
  11. .into_iter()
  12. .map(|f| rsx! { "{f}" })
  13. .collect::<Vec<_>>(),
  14. // Use optionals
  15. Some(rsx! { "Some" }),
  16. ))
  17. }