mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 03:29:59 +08:00
d549964493
* demo: update demo * add * fix lint
43 lines
979 B
TypeScript
43 lines
979 B
TypeScript
import React from 'react';
|
|
import { Select, Space } from 'antd';
|
|
|
|
const handleChange = (value: string) => {
|
|
console.log(`selected ${value}`);
|
|
};
|
|
|
|
const App: React.FC = () => (
|
|
<Space wrap>
|
|
<Select
|
|
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
|
|
defaultValue="lucy"
|
|
style={{ width: 120 }}
|
|
disabled
|
|
options={[{ value: 'lucy', label: 'Lucy' }]}
|
|
/>
|
|
<Select
|
|
defaultValue="lucy"
|
|
style={{ width: 120 }}
|
|
loading
|
|
options={[{ value: 'lucy', label: 'Lucy' }]}
|
|
/>
|
|
<Select
|
|
defaultValue="lucy"
|
|
style={{ width: 120 }}
|
|
allowClear
|
|
options={[{ value: 'lucy', label: 'Lucy' }]}
|
|
/>
|
|
</Space>
|
|
);
|
|
|
|
export default App;
|