mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-04 17:09:46 +08:00
fe8d59754e
* fix: CP pass not override * test: Update test case * docs: missing demo
71 lines
1.2 KiB
TypeScript
71 lines
1.2 KiB
TypeScript
import React from 'react';
|
|
import { Select } from 'antd';
|
|
|
|
const handleChange = (value: string) => {
|
|
console.log(`selected ${value}`);
|
|
};
|
|
|
|
const App: React.FC = () => (
|
|
<>
|
|
<Select
|
|
defaultValue="lucy"
|
|
style={{ width: 120 }}
|
|
onChange={handleChange}
|
|
options={[
|
|
{
|
|
value: 'jack',
|
|
label: 'Jack',
|
|
},
|
|
{
|
|
value: 'lucy',
|
|
label: 'Lucy',
|
|
},
|
|
{
|
|
value: 'disabled',
|
|
disabled: true,
|
|
label: 'Disabled',
|
|
},
|
|
{
|
|
value: 'Yiminghe',
|
|
label: 'yiminghe',
|
|
},
|
|
]}
|
|
/>
|
|
<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',
|
|
},
|
|
]}
|
|
/>
|
|
</>
|
|
);
|
|
|
|
export default App;
|