mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-16 01:29:11 +08:00
d549964493
* demo: update demo * add * fix lint
42 lines
904 B
TypeScript
42 lines
904 B
TypeScript
import React from 'react';
|
|
import { Select, Space } 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 = () => (
|
|
<Space style={{ width: '100%' }} direction="vertical">
|
|
<Select
|
|
mode="multiple"
|
|
allowClear
|
|
style={{ width: '100%' }}
|
|
placeholder="Please select"
|
|
defaultValue={['a10', 'c12']}
|
|
onChange={handleChange}
|
|
options={options}
|
|
/>
|
|
<Select
|
|
mode="multiple"
|
|
disabled
|
|
style={{ width: '100%' }}
|
|
placeholder="Please select"
|
|
defaultValue={['a10', 'c12']}
|
|
onChange={handleChange}
|
|
options={options}
|
|
/>
|
|
</Space>
|
|
);
|
|
|
|
export default App;
|