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
|
|
|
}
|
|
|
|
|
|
|
|
fn app(cx: Scope) -> Element {
|
2022-12-07 21:11:40 +00:00
|
|
|
let model = use_state(cx, || String::from("asd"));
|
2022-02-23 02:36:59 +00:00
|
|
|
|
2023-01-28 02:35:46 +00:00
|
|
|
println!("{model}");
|
2022-02-23 02:36:59 +00:00
|
|
|
|
|
|
|
cx.render(rsx! {
|
|
|
|
textarea {
|
|
|
|
class: "border",
|
|
|
|
rows: "10",
|
|
|
|
cols: "80",
|
|
|
|
value: "{model}",
|
2022-03-01 07:50:03 +00:00
|
|
|
oninput: move |e| model.set(e.value.clone()),
|
2022-02-23 02:36:59 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|