Input
由核心管理的受控文本编辑器,支持原生键盘和文本服务。
正在加载交互演示…
text_input(name.as_str())
.placeholder("Name")
.on_input(edit)#导入
从 quickgui 导入 text_input。
use quickgui::*;#用法
text_input(name.as_str())
.placeholder("Name")
.on_input(edit)#API 参考
展开条目查看说明和完整签名。短横线表示声明中未记录默认值。
text_input
查看源码pub fn text_input(value: impl Into<Arc<str>>) -> ElementCreate a controlled, single-line text input. Attach a stable [`crate::InputListener`] with [`Element::on_input`].
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查看源码