-
-
Notifications
You must be signed in to change notification settings - Fork 46.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix-1771' of https://github.com/ddcat1115/ant-design in…
…to ddcat1115-fix-1771
- Loading branch information
Showing
7 changed files
with
121 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
order: 2 | ||
title: 前置/后置标签 | ||
--- | ||
|
||
用于配置一些固定组合。 | ||
|
||
````jsx | ||
import { Input } from 'antd'; | ||
|
||
ReactDOM.render( | ||
<Input addonBefore="Http://" addonAfter=".com" defaultValue="mysite" /> | ||
, mountNode); | ||
```` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
order: 0 | ||
title: 基本使用 | ||
--- | ||
|
||
基本使用。 | ||
|
||
````jsx | ||
import { Input } from 'antd'; | ||
|
||
ReactDOM.render(<Input placeholder="基本使用" />, mountNode); | ||
```` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
order: 3 | ||
title: 输入框组合 | ||
--- | ||
|
||
各类输入框的组合展现。 | ||
|
||
````jsx | ||
import { Input, Select, Col } from 'antd'; | ||
const InputGroup = Input.Group; | ||
const Option = Select.Option; | ||
|
||
ReactDOM.render( | ||
<div> | ||
<InputGroup size="large"> | ||
<Input placeholder="www.mysite" /> | ||
<div className="ant-input-group-wrap"> | ||
<Select defaultValue=".com" style={{ width: 70 }}> | ||
<Option value=".com">.com</Option> | ||
<Option value=".jp">.jp</Option> | ||
<Option value=".cn">.cn</Option> | ||
<Option value=".org">.org</Option> | ||
</Select> | ||
</div> | ||
</InputGroup> | ||
<InputGroup size="large" style={{ marginTop: 8 }}> | ||
<Col span="4"> | ||
<Input defaultValue="0571" /> | ||
</Col> | ||
<Col span="8"> | ||
<Input defaultValue="26888888" /> | ||
</Col> | ||
</InputGroup> | ||
</div> | ||
, mountNode); | ||
```` |
4 changes: 2 additions & 2 deletions
4
components/form/demo/search-input.md → components/input/demo/search-input.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
--- | ||
order: 10 | ||
order: 4 | ||
title: 搜索框 | ||
--- | ||
|
||
带有搜索按钮。 | ||
带有搜索按钮的输入框。 | ||
|
||
````jsx | ||
import { Input, Button } from 'antd'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
category: Components | ||
chinese: 输入框 | ||
type: Form Control | ||
english: Input | ||
--- | ||
|
||
通过鼠标或键盘输入内容,是最基础的表单域的包装。 | ||
|
||
## 何时使用 | ||
|
||
- 需要用户输入表单域内容时。 | ||
- 提供组合型输入框,带搜索的输入框,还可以进行大小选择。 | ||
|
||
|
||
|
||
## API | ||
|
||
### Input | ||
|
||
| 参数 | 说明 | 类型 | 可选值 | 默认值 | | ||
|-----------|------------------------------------------|------------|-------|--------| | ||
| type | 【必须】声明 input 类型,同原生 input 标签的 type 属性 | 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) | | | | ||
|
||
> 如果 `Input` 在 `Form.Item` 内,并且 `Form.Item` 设置了 `id` 和 `options` 属性,则 `value` `defaultValue` 和 `id` 属性会被自动设置。 | ||
#### Input.Group | ||
|
||
| 参数 | 说明 | 类型 | 可选值 | 默认值 | | ||
|-----------|------------------------------------------|------------|-------|--------| | ||
| size | `Input.Group` 中所有的 `Input` 的大小 | string | {'large','default','small'} | 'default' | | ||
|
||
```html | ||
<Input.Group className={string}> | ||
<Input /> | ||
<Input /> | ||
</Input.Group> | ||
``` |