From 03d6bdc9428460ae4c3b40e0d80cba68dcdb6308 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 5 Dec 2016 13:05:58 +0800 Subject: [PATCH] update input API doc --- components/input/index.en-US.md | 38 ++++++++++++++++----------------- components/input/index.zh-CN.md | 36 +++++++++++++++---------------- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/components/input/index.en-US.md b/components/input/index.en-US.md index 47e95b16f6..4485a2568e 100644 --- a/components/input/index.en-US.md +++ b/components/input/index.en-US.md @@ -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 - + diff --git a/components/input/index.zh-CN.md b/components/input/index.zh-CN.md index 046f99f65f..c6d6dc15fa 100644 --- a/components/input/index.zh-CN.md +++ b/components/input/index.zh-CN.md @@ -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 - +