1
0

textarea.rs 439 B

1234567891011121314151617181920212223
  1. // How to use textareas
  2. use dioxus::prelude::*;
  3. fn main() {
  4. dioxus::desktop::launch(app);
  5. }
  6. fn app(cx: Scope) -> Element {
  7. let model = use_state(&cx, || String::from("asd"));
  8. println!("{}", model);
  9. cx.render(rsx! {
  10. textarea {
  11. class: "border",
  12. rows: "10",
  13. cols: "80",
  14. value: "{model}",
  15. oninput: move |e| model.set(e.value.clone()),
  16. }
  17. })
  18. }