ant-design/components/input-number/demo/prefix.md
2022-05-23 14:37:16 +08:00

594 B

order title
7
zh-CN en-US
前缀 Prefix

zh-CN

在输入框上添加前缀图标。

en-US

Add a prefix inside input.

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;