mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 17:59:57 +08:00
35 lines
594 B
Markdown
35 lines
594 B
Markdown
---
|
|
order: 7
|
|
title:
|
|
zh-CN: 前缀
|
|
en-US: Prefix
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
在输入框上添加前缀图标。
|
|
|
|
## en-US
|
|
|
|
Add a prefix inside input.
|
|
|
|
```tsx
|
|
import { UserOutlined } from '@ant-design/icons';
|
|
import { InputNumber } from 'antd';
|
|
import React from 'react';
|
|
|
|
const App: React.FC = () => (
|
|
<>
|
|
<InputNumber prefix="¥" style={{ width: '100%' }} />
|
|
<br />
|
|
<br />
|
|
<InputNumber addonBefore={<UserOutlined />} prefix="¥" style={{ width: '100%' }} />
|
|
<br />
|
|
<br />
|
|
<InputNumber prefix="¥" disabled style={{ width: '100%' }} />
|
|
</>
|
|
);
|
|
|
|
export default App;
|
|
```
|