You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
850 B
41 lines
850 B
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;
|
|
|