mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-17 10:28:06 +08:00
6776bb8916
* docs: update demo * chore: add script * test: fix demo test * docs: convert demos * chore: move script * test: remove react-dom import * chore: update deps * docs: update riddle js * test: fix image test * docs: fix riddle demo
49 lines
1.1 KiB
Markdown
49 lines
1.1 KiB
Markdown
---
|
|
order: 2
|
|
title:
|
|
zh-CN: 前置/后置标签
|
|
en-US: Pre / Post tab
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
用于配置一些固定组合。
|
|
|
|
## en-US
|
|
|
|
Using pre & post tabs example.
|
|
|
|
```jsx
|
|
import { InputNumber, Select, Space, Cascader } from 'antd';
|
|
import { SettingOutlined } from '@ant-design/icons';
|
|
|
|
const { Option } = Select;
|
|
|
|
const selectBefore = (
|
|
<Select defaultValue="add" style={{ width: 60 }}>
|
|
<Option value="add">+</Option>
|
|
<Option value="minus">-</Option>
|
|
</Select>
|
|
);
|
|
const selectAfter = (
|
|
<Select defaultValue="USD" style={{ width: 60 }}>
|
|
<Option value="USD">$</Option>
|
|
<Option value="EUR">€</Option>
|
|
<Option value="GBP">£</Option>
|
|
<Option value="CNY">¥</Option>
|
|
</Select>
|
|
);
|
|
|
|
export default () => (
|
|
<Space direction="vertical">
|
|
<InputNumber addonBefore="+" addonAfter="$" defaultValue={100} />
|
|
<InputNumber addonBefore={selectBefore} addonAfter={selectAfter} defaultValue={100} />
|
|
<InputNumber addonAfter={<SettingOutlined />} defaultValue={100} />
|
|
<InputNumber
|
|
addonBefore={<Cascader placeholder="cascader" style={{ width: 150 }} />}
|
|
defaultValue={100}
|
|
/>
|
|
</Space>
|
|
);
|
|
```
|