2021-10-30 22:25:12 +08:00
|
|
|
---
|
|
|
|
order: 7
|
|
|
|
title:
|
|
|
|
zh-CN: 前缀
|
|
|
|
en-US: Prefix
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
在输入框上添加前缀图标。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
Add a prefix inside input.
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
```tsx
|
|
|
|
import { UserOutlined } from '@ant-design/icons';
|
2022-01-02 15:16:21 +08:00
|
|
|
import { InputNumber } from 'antd';
|
2022-05-21 22:14:15 +08:00
|
|
|
import React from 'react';
|
2021-10-30 22:25:12 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => (
|
2021-10-30 22:25:12 +08:00
|
|
|
<>
|
|
|
|
<InputNumber prefix="¥" style={{ width: '100%' }} />
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<InputNumber addonBefore={<UserOutlined />} prefix="¥" style={{ width: '100%' }} />
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<InputNumber prefix="¥" disabled style={{ width: '100%' }} />
|
2022-04-03 23:27:45 +08:00
|
|
|
</>
|
2021-10-30 22:25:12 +08:00
|
|
|
);
|
2022-05-19 09:46:26 +08:00
|
|
|
|
|
|
|
export default App;
|
2021-10-30 22:25:12 +08:00
|
|
|
```
|