Skip to content

Input 输入类组件

props.type实际组件
textareaaTextarea
searchaInputSearch
passwordaInputPassword
其他(默认)aInput

Input

规则

基础示例

整段禁用

尺寸对比(小 / 中 / 大)

Events

参考:Antdv Next Input

valuestring

Props

参数说明类型默认值版本
addonAfter后置标签(建议 Space.Compact)VueNode--
addonBefore前置标签(建议 Space.Compact)VueNode--
allowClear可清除boolean |--
bordered是否有边框,请用 variantbooleantrue-
classes语义化 classRecord<SemanticDOM, string> | function--
count字符计数配置CountConfig--
disabled禁用booleanfalse-
ididstring--
maxlength最大长度number--
prefix前缀VueNode--
showCount字数展示boolean | objectfalse-
status校验状态error | warning--
styles语义化 styleRecord<SemanticDOM, CSSProperties> | function--
size尺寸large | middle | small--
suffix后缀VueNode--
type原生 input type(textarea 请用 TextArea)stringtext-
value内容string--
variant形态变体outlined | borderless | filled | underlinedoutlined-

Events

事件说明类型版本
change内容变化function(e)-
pressEnter回车function(e)-
clear清除() => void-

若 Input 位于 Form.Item 且 Item 设置了 idvalue / defaultValue / id 可能被自动关联(见 UI 文档)。


TextArea

可使用 type: 'textarea',或 type: 'input'props.type: 'textarea'

规则示例

参考:Antdv Next Input.TextArea

valuestring

额外 Props(相对 Input)

参数说明类型默认值版本
autoSize自适应高度boolean |false-
classes语义化 classRecord<SemanticDOM, string> | function--
styles语义化 styleRecord<SemanticDOM, CSSProperties> | function--

其余与 Input 一致,并与原生 textarea 一致。


InputSearch

参考:Antdv Next Input.Search

额外 Props

参数说明类型默认值版本
classes语义化 classRecord<SemanticDOM, string> | function--
enterButton确认按钮VueNodefalse-
loadingloadingbooleanfalse-
styles语义化 styleRecord<SemanticDOM, CSSProperties> | function--

其余与 Input 一致。

Events

事件说明类型版本
search搜索/清除/回车function(value, event, { source: input | clear })-

InputPassword

参考:Antdv Next Input.Password

Props

参数说明类型默认值版本
classes语义化 classRecord<SemanticDOM, string>--
iconRender自定义显隐图标(visible) => VueNode默认眼睛图标-
styles语义化 styleRecord<SemanticDOM, CSSProperties>--
visibilityToggle是否显示切换按钮boolean | VisibilityToggletrue-

FormCreate 是一个开源项目,基于 MIT 许可证发布,欢迎个人和企业用户免费使用