TextArea
多行文本编辑基础组件,受控值约定与 Input 相同。
正在加载交互演示…
text_area(notes.as_str())
.placeholder("Notes")
.on_input(edit)#导入
从 quickgui 导入 text_area。
use quickgui::*;#用法
text_area(notes.as_str())
.placeholder("Notes")
.on_input(edit)#API 参考
展开条目查看说明和完整签名。短横线表示声明中未记录默认值。
text_area
查看源码pub fn text_area(value: impl Into<Arc<str>>) -> ElementCreate a controlled, multiline text area with web-style soft wrapping. Attach a stable [`crate::InputListener`] with [`Element::on_input`]. Use [`Element::no_wrap`] for code-editor-style horizontal scrolling.
on_inputpub fn on_input<V>(mut self, listener: crate::InputListener<V>) -> Self—
Attach a controlled-value listener registered by [`crate::ViewContext::input_listener`].
pub fn on_input<V>(mut self, listener: crate::InputListener<V>) -> Self查看源码placeholderpub fn placeholder(mut self, placeholder: impl Into<Arc<str>>) -> Self—
Set placeholder text for a [`text_input`] element.
pub fn placeholder(mut self, placeholder: impl Into<Arc<str>>) -> Self查看源码