mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 19:19:26 +08:00
update input API doc
This commit is contained in:
parent
392805e0e5
commit
03d6bdc942
@ -16,18 +16,18 @@ Keyboard and mouse can be used for providing or changing data.
|
||||
|
||||
### Input
|
||||
|
||||
| Property | Description | Type | Available Values | Default |
|
||||
|----------------|-----------------------|----------|------------------|---------------|
|
||||
| type | The type of input. For a multi-line input, the 'textarea' value can be used. | string | 'text' or 'textarea' | 'text' |
|
||||
| id | The identifier. | number or string | | |
|
||||
| value | The content value. | any | | |
|
||||
| defaultValue | The initial value. | any | | |
|
||||
| size | The size of the input box. The implicit value is 'default'. Note: in the context of a form, the 'large' size is used. | string | {'large','default','small'} | 'default' |
|
||||
| disabled | Tell if the input is disabled. | bool | | false |
|
||||
| addonBefore | The label text displayed before (on the left side of) the input field. | node | | |
|
||||
| addonAfter | The label text displayed after (on the right side of) the input field. | node | | |
|
||||
| onPressEnter | The callback function that is triggered when pressing Enter key. | function(e) | | |
|
||||
| autosize | Height autosize feature, available when type="textarea". | bool or object | `true` or `{ minRows: 2, maxRows: 6 }` | false |
|
||||
| Property | Description | Type | Default |
|
||||
|----------------|-----------------------|----------|---------------|
|
||||
| type | The type of input, `text` or `textarea` | string | `text` |
|
||||
| id | The ID for input | string | |
|
||||
| value | The input content value | string | |
|
||||
| defaultValue | The initial input content | string | |
|
||||
| size | The size of the input box. Note: in the context of a form, the `large` size is used. Available: `large` `default` `small` | string | `default` |
|
||||
| disabled | Tell if the input is disabled. | boolean | false |
|
||||
| addonBefore | The label text displayed before (on the left side of) the input field. | React.Node | |
|
||||
| addonAfter | The label text displayed after (on the right side of) the input field. | React.Node | |
|
||||
| onPressEnter | The callback function that is triggered when pressing Enter key. | function(e) | |
|
||||
| autosize | Height autosize feature, available when type="textarea", can be set to `true|false` or a object `{ minRows: 2, maxRows: 6 }` | boolean or object | false |
|
||||
|
||||
> When `Input` is used in a `Form.Item` context, if the `Form.Item` has the `id` and `options` props defined
|
||||
then `value`, `defaultValue`, and `id` props are automatically set.
|
||||
@ -36,20 +36,20 @@ then `value`, `defaultValue`, and `id` props are automatically set.
|
||||
|
||||
`Added in 2.5.0`
|
||||
|
||||
| Property | Description | Type | Available Values | Default |
|
||||
|-----------|------------------------------------------|------------|-------|--------|
|
||||
| onSearch | The callback function that is triggered when you click on the search-icon or press Enter key. | function(value) | | |
|
||||
| Property | Description | Type | Default |
|
||||
|-----------|--------------------------------------|------------|---------|
|
||||
| onSearch | The callback function that is triggered when you click on the search-icon or press Enter key. | function(value) | |
|
||||
|
||||
Support all props of `Input`.
|
||||
|
||||
#### Input.Group
|
||||
|
||||
| Property | Description | Type | Available Values | Default |
|
||||
|-----------|----------------------------------|--------|-----------------------------|-----------|
|
||||
| size | The size of `Input.Group` specifies the size of the included `Input` fields. | string | {'large','default','small'} | 'default' |
|
||||
| Property | Description | Type | Default |
|
||||
|-----------|----------------------------------|--------|-----------|
|
||||
| size | The size of `Input.Group` specifies the size of the included `Input` fields. Available: `large` `default` `small` | string | `default` |
|
||||
|
||||
```html
|
||||
<Input.Group className={string}>
|
||||
<Input.Group>
|
||||
<Input />
|
||||
<Input />
|
||||
</Input.Group>
|
||||
|
@ -16,18 +16,18 @@ title: Input
|
||||
|
||||
### Input
|
||||
|
||||
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|-----------------------------------------|------------|-------|--------|
|
||||
| type | 【必须】声明 input 类型,同原生 input 标签的 type 属性。另外提供 `type="textarea"`。 | string | | 'text' |
|
||||
| id | id | number 或 string | | |
|
||||
| value | value 值 | any | | |
|
||||
| defaultValue | 设置初始默认值 | any | | |
|
||||
| size | 控件大小,默认值为 default 。注:标准表单内的输入框大小限制为 large。 | string | {'large','default','small'} | 'default' |
|
||||
| disabled | 是否禁用状态,默认为 false | bool | | false |
|
||||
| addonBefore | 带标签的 input,设置前置标签 | node | | |
|
||||
| addonAfter | 带标签的 input,设置后置标签 | node | | |
|
||||
| onPressEnter | 按下回车的回调 | function(e) | | |
|
||||
| autosize | 自适应内容高度,只对 `type="textarea"` 有效 | bool or object | `true` or `{ minRows: 2, maxRows: 6 }` | false |
|
||||
| type | 声明 input 类型,同原生 input 标签的 type 属性。另外提供 `type="textarea"`。 | string | `text` |
|
||||
| id | 输入框的 id | string | |
|
||||
| value | 输入框内容 | string | |
|
||||
| defaultValue | 输入框默认内容 | string | |
|
||||
| size | 控件大小。注:标准表单内的输入框大小限制为 `large`。可选 `large` `default` `small` | string | `default` |
|
||||
| disabled | 是否禁用状态,默认为 false | boolean | false |
|
||||
| addonBefore | 带标签的 input,设置前置标签 | React.Node | |
|
||||
| addonAfter | 带标签的 input,设置后置标签 | React.Node | |
|
||||
| onPressEnter | 按下回车的回调 | function(e) | |
|
||||
| autosize | 自适应内容高度,只对 `type="textarea"` 有效,可设置为 `true|false` 或对象:`{ minRows: 2, maxRows: 6 }` | boolean or object | false |
|
||||
|
||||
> 如果 `Input` 在 `Form.Item` 内,并且 `Form.Item` 设置了 `id` 和 `options` 属性,则 `value` `defaultValue` 和 `id` 属性会被自动设置。
|
||||
|
||||
@ -35,20 +35,20 @@ title: Input
|
||||
|
||||
`Added in 2.5.0`
|
||||
|
||||
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
||||
|-----------|------------------------------------------|------------|-------|--------|
|
||||
| onSearch | 点击搜索或按下回车键时的回调 | function(value) | | |
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|-----------------------------------------|-----------|-------|
|
||||
| onSearch | 点击搜索或按下回车键时的回调 | function(value) | |
|
||||
|
||||
其余属性和 Input 一致。
|
||||
|
||||
#### Input.Group
|
||||
|
||||
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
||||
|-----------|------------------------------------------|------------|-------|--------|
|
||||
| size | `Input.Group` 中所有的 `Input` 的大小 | string | {'large','default','small'} | 'default' |
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|-----------|-----------------------------------------|-------------|-------|
|
||||
| size | `Input.Group` 中所有的 `Input` 的大小,可选 `large` `default` `small` | string | `default` |
|
||||
|
||||
```html
|
||||
<Input.Group className={string}>
|
||||
<Input.Group>
|
||||
<Input />
|
||||
<Input />
|
||||
</Input.Group>
|
||||
|
Loading…
Reference in New Issue
Block a user