2016-06-16 22:18:00 +08:00
|
|
|
---
|
|
|
|
order: 2
|
2016-08-22 09:53:39 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 前置/后置标签
|
|
|
|
en-US: Pre / Post tab
|
2016-06-16 22:18:00 +08:00
|
|
|
---
|
|
|
|
|
2016-08-22 09:53:39 +08:00
|
|
|
## zh-CN
|
|
|
|
|
2016-06-16 22:18:00 +08:00
|
|
|
用于配置一些固定组合。
|
|
|
|
|
2016-08-22 09:53:39 +08:00
|
|
|
## en-US
|
|
|
|
|
|
|
|
Using pre & post tabs example.
|
|
|
|
|
2017-02-13 10:55:53 +08:00
|
|
|
````jsx
|
2016-11-08 11:46:41 +08:00
|
|
|
import { Input, Select, Icon } from 'antd';
|
2016-06-16 22:18:00 +08:00
|
|
|
const Option = Select.Option;
|
|
|
|
|
|
|
|
const selectBefore = (
|
2017-11-06 21:28:51 +08:00
|
|
|
<Select defaultValue="Http://" style={{ width: 90 }}>
|
2016-06-16 22:18:00 +08:00
|
|
|
<Option value="Http://">Http://</Option>
|
|
|
|
<Option value="Https://">Https://</Option>
|
|
|
|
</Select>
|
|
|
|
);
|
|
|
|
const selectAfter = (
|
2017-11-06 21:28:51 +08:00
|
|
|
<Select defaultValue=".com" style={{ width: 80 }}>
|
2016-06-16 22:18:00 +08:00
|
|
|
<Option value=".com">.com</Option>
|
|
|
|
<Option value=".jp">.jp</Option>
|
|
|
|
<Option value=".cn">.cn</Option>
|
|
|
|
<Option value=".org">.org</Option>
|
|
|
|
</Select>
|
|
|
|
);
|
|
|
|
|
|
|
|
ReactDOM.render(
|
|
|
|
<div>
|
2016-11-08 11:46:41 +08:00
|
|
|
<div style={{ marginBottom: 16 }}>
|
|
|
|
<Input addonBefore="Http://" addonAfter=".com" defaultValue="mysite" />
|
|
|
|
</div>
|
|
|
|
<div style={{ marginBottom: 16 }}>
|
2016-06-16 22:18:00 +08:00
|
|
|
<Input addonBefore={selectBefore} addonAfter={selectAfter} defaultValue="mysite" />
|
|
|
|
</div>
|
2016-11-08 11:46:41 +08:00
|
|
|
<div style={{ marginBottom: 16 }}>
|
|
|
|
<Input addonAfter={<Icon type="setting" />} defaultValue="mysite" />
|
|
|
|
</div>
|
2016-06-16 22:18:00 +08:00
|
|
|
</div>
|
|
|
|
, mountNode);
|
|
|
|
````
|