pub fn NumberInput(props: NumberInputProps) -> impl IntoViewExpand description
数字输入框:单位写在框内右侧,两侧 −/+ 步进;越界时边框与说明一起变红。
输入过程中保留草稿文本,只有在 [min, max] 内的整数才回调 onchange;
越界或非数字时显示红环与范围说明,不改动父组件的值。
Props:
id:input id,用于与 label 关联(缺省挂载后用内部计数器生成)value:当前值(受控,可传信号)min/max:允许范围(含端点)step:步进,缺省 1unit:单位,如「天」「次/分钟」hint:范围内时显示的说明(可选)aria_label:没有可见标签时的无障碍名称(可选)onchange:合法新值回调
§Required Props
value:impl Into<Signal<i64>>min:i64max:i64onchange:impl Into<Callback<i64>>
§Optional Props
id:impl Into<MaybeProp<String>>step:i64unit: [&'static str]hint:impl Into<MaybeProp<String>>aria_label: [&'static str]