Input 输入类组件
| props.type | 实际组件 |
|---|---|
textarea | aTextarea |
search | aInputSearch |
password | aInputPassword |
| 其他(默认) | aInput |
Input
规则
基础示例
整段禁用
尺寸对比(小 / 中 / 大)
Events
value:string
Props
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|---|---|---|---|---|
| addonAfter | 后置标签(建议 Space.Compact) | VueNode | - | - |
| addonBefore | 前置标签(建议 Space.Compact) | VueNode | - | - |
| allowClear | 可清除 | boolean | | - | - |
| bordered | 是否有边框,请用 variant | boolean | true | - |
| classes | 语义化 class | Record<SemanticDOM, string> | function | - | - |
| count | 字符计数配置 | CountConfig | - | - |
| disabled | 禁用 | boolean | false | - |
| id | id | string | - | - |
| maxlength | 最大长度 | number | - | - |
| prefix | 前缀 | VueNode | - | - |
| showCount | 字数展示 | boolean | object | false | - |
| status | 校验状态 | error | warning | - | - |
| styles | 语义化 style | Record<SemanticDOM, CSSProperties> | function | - | - |
| size | 尺寸 | large | middle | small | - | - |
| suffix | 后缀 | VueNode | - | - |
| type | 原生 input type(textarea 请用 TextArea) | string | text | - |
| value | 内容 | string | - | - |
| variant | 形态变体 | outlined | borderless | filled | underlined | outlined | - |
Events
| 事件 | 说明 | 类型 | 版本 |
|---|---|---|---|
| change | 内容变化 | function(e) | - |
| pressEnter | 回车 | function(e) | - |
| clear | 清除 | () => void | - |
若 Input 位于 Form.Item 且 Item 设置了 id,value / defaultValue / id 可能被自动关联(见 UI 文档)。
TextArea
可使用 type: 'textarea',或 type: 'input' 且 props.type: 'textarea'。
规则示例
value:string
额外 Props(相对 Input)
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|---|---|---|---|---|
| autoSize | 自适应高度 | boolean | | false | - |
| classes | 语义化 class | Record<SemanticDOM, string> | function | - | - |
| styles | 语义化 style | Record<SemanticDOM, CSSProperties> | function | - | - |
其余与 Input 一致,并与原生 textarea 一致。
InputSearch
额外 Props
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|---|---|---|---|---|
| classes | 语义化 class | Record<SemanticDOM, string> | function | - | - |
| enterButton | 确认按钮 | VueNode | false | - |
| loading | loading | boolean | false | - |
| styles | 语义化 style | Record<SemanticDOM, CSSProperties> | function | - | - |
其余与 Input 一致。
Events
| 事件 | 说明 | 类型 | 版本 |
|---|---|---|---|
| search | 搜索/清除/回车 | function(value, event, { source: input | clear }) | - |
InputPassword
Props
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|---|---|---|---|---|
| classes | 语义化 class | Record<SemanticDOM, string> | - | - |
| iconRender | 自定义显隐图标 | (visible) => VueNode | 默认眼睛图标 | - |
| styles | 语义化 style | Record<SemanticDOM, CSSProperties> | - | - |
| visibilityToggle | 是否显示切换按钮 | boolean | VisibilityToggle | true | - |


