ant-design/components/select/demo/basic.tsx
二货爱吃白萝卜 fe8d59754e
fix: Modal hooks not pass CP (#39513)
* fix: CP pass not override

* test: Update test case

* docs: missing demo
2022-12-13 13:57:17 +08:00

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;