dioxus/examples/textarea.rs

22 lines
384 B
Rust
Raw Normal View History

2022-02-22 21:36:59 -05:00
// How to use textareas
use dioxus::prelude::*;
fn main() {
launch_desktop(app);
2022-02-22 21:36:59 -05:00
}
fn app() -> Element {
let mut model = use_signal(|| String::from("asd"));
2022-02-22 21:36:59 -05:00
2024-01-16 13:18:46 -06:00
rsx! {
2022-02-22 21:36:59 -05:00
textarea {
class: "border",
rows: "10",
cols: "80",
value: "{model}",
2023-09-01 15:38:55 -05:00
oninput: move |e| model.set(e.value().clone()),
2022-02-22 21:36:59 -05:00
}
2024-01-13 21:12:21 -08:00
}
2022-02-22 21:36:59 -05:00
}