mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 08:59:15 +08:00
42 lines
850 B
TypeScript
42 lines
850 B
TypeScript
|
import React from 'react';
|
||
|
import { Select } from 'antd';
|
||
|
import type { SelectProps } from 'antd';
|
||
|
|
||
|
const options: SelectProps['options'] = [];
|
||
|
for (let i = 10; i < 36; i++) {
|
||
|
options.push({
|
||
|
label: i.toString(36) + i,
|
||
|
value: i.toString(36) + i,
|
||
|
});
|
||
|
}
|
||
|
|
||
|
const handleChange = (value: string[]) => {
|
||
|
console.log(`selected ${value}`);
|
||
|
};
|
||
|
|
||
|
const App: React.FC = () => (
|
||
|
<>
|
||
|
<Select
|
||
|
mode="multiple"
|
||
|
allowClear
|
||
|
style={{ width: '100%' }}
|
||
|
placeholder="Please select"
|
||
|
defaultValue={['a10', 'c12']}
|
||
|
onChange={handleChange}
|
||
|
options={options}
|
||
|
/>
|
||
|
<br />
|
||
|
<Select
|
||
|
mode="multiple"
|
||
|
disabled
|
||
|
style={{ width: '100%' }}
|
||
|
placeholder="Please select"
|
||
|
defaultValue={['a10', 'c12']}
|
||
|
onChange={handleChange}
|
||
|
options={options}
|
||
|
/>
|
||
|
</>
|
||
|
);
|
||
|
|
||
|
export default App;
|