2022-02-23 02:36:59 +00:00
|
|
|
// How to use textareas
|
|
|
|
|
|
|
|
use dioxus::prelude::*;
|
|
|
|
|
|
|
|
fn main() {
|
2022-07-09 19:15:20 +00:00
|
|
|
dioxus_desktop::launch(app);
|
2022-02-23 02:36:59 +00:00
|
|
|
}
|
|
|
|
|
2024-01-14 04:51:37 +00:00
|
|
|
fn app() -> Element {
|
2024-01-16 07:24:59 +00:00
|
|
|
let mut model = use_signal(|| String::from("asd"));
|
2022-02-23 02:36:59 +00:00
|
|
|
|
2024-01-14 05:12:21 +00:00
|
|
|
rsx! {
|
2022-02-23 02:36:59 +00:00
|
|
|
textarea {
|
|
|
|
class: "border",
|
|
|
|
rows: "10",
|
|
|
|
cols: "80",
|
|
|
|
value: "{model}",
|
2023-09-01 20:38:55 +00:00
|
|
|
oninput: move |e| model.set(e.value().clone()),
|
2022-02-23 02:36:59 +00:00
|
|
|
}
|
2024-01-14 05:12:21 +00:00
|
|
|
}
|
2022-02-23 02:36:59 +00:00
|
|
|
}
|