mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 05:28:20 +08:00
d549964493
* demo: update demo * add * fix lint
37 lines
889 B
TypeScript
37 lines
889 B
TypeScript
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;
|