shorthand.rsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #[component]
  2. fn SomePassthru(class: String, id: String, children: Element) -> Element {
  3. rsx! {
  4. div {
  5. // Comments
  6. class,
  7. "hello world"
  8. }
  9. h1 { class, "hello world" }
  10. h1 { class, {children} }
  11. h1 { class, id, {children} }
  12. h1 { class,
  13. "hello world"
  14. {children}
  15. }
  16. h1 { id,
  17. "hello world"
  18. {children}
  19. }
  20. Other { class, children }
  21. Other { class,
  22. "hello world"
  23. {children}
  24. }
  25. div {
  26. // My comment here 1
  27. // My comment here 2
  28. // My comment here 3
  29. // My comment here 4
  30. class: "asdasd",
  31. // Comment here
  32. onclick: move |_| {
  33. let a = 10;
  34. let b = 40;
  35. let c = 50;
  36. },
  37. // my comment
  38. // This here
  39. "hi"
  40. }
  41. // Comment head
  42. div { class: "asd", "Jon" }
  43. // Comment head
  44. div {
  45. // Collapse
  46. class: "asd",
  47. "Jon"
  48. }
  49. }
  50. }