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.
36 lines
889 B
36 lines
889 B
import React from 'react';
|
|
import { MehOutlined, SmileOutlined } from '@ant-design/icons';
|
|
import { Select, Space } from 'antd';
|
|
|
|
const smileIcon = <SmileOutlined />;
|
|
const mehIcon = <MehOutlined />;
|
|
|
|
const handleChange = (value: string) => {
|
|
console.log(`selected ${value}`);
|
|
};
|
|
|
|
const App: React.FC = () => (
|
|
<Space wrap>
|
|
<Select
|
|
suffixIcon={smileIcon}
|
|
defaultValue="lucy"
|
|
style={{ width: 120 }}
|
|
onChange={handleChange}
|
|
options={[
|
|
{ value: 'jack', label: 'Jack' },
|
|
{ value: 'lucy', label: 'Lucy' },
|
|
{ value: 'Yiminghe', label: 'yiminghe' },
|
|
{ value: 'disabled', label: 'Disabled', disabled: true },
|
|
]}
|
|
/>
|
|
<Select
|
|
suffixIcon={mehIcon}
|
|
defaultValue="lucy"
|
|
style={{ width: 120 }}
|
|
disabled
|
|
options={[{ value: 'lucy', label: 'Lucy' }]}
|
|
/>
|
|
</Space>
|
|
);
|
|
|
|
export default App;
|
|
|