You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1023 B
34 lines
1023 B
import React from 'react';
|
|
import { SettingOutlined } from '@ant-design/icons';
|
|
import { Cascader, InputNumber, Select, Space } from 'antd';
|
|
|
|
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;
|
|
|