mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-11 23:00:20 +08:00
52 lines
1.2 KiB
Markdown
52 lines
1.2 KiB
Markdown
---
|
|
order: 2
|
|
title:
|
|
zh-CN: 前置/后置标签
|
|
en-US: Pre / Post tab
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
用于配置一些固定组合。
|
|
|
|
## en-US
|
|
|
|
Using pre & post tabs example.
|
|
|
|
```tsx
|
|
import { SettingOutlined } from '@ant-design/icons';
|
|
import { Cascader, InputNumber, Select, Space } from 'antd';
|
|
import React from 'react';
|
|
|
|
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>
|
|
);
|
|
|
|
const App: React.FC = () => (
|
|
<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>
|
|
);
|
|
|
|
export default App;
|
|
```
|