mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-02 07:39:36 +08:00
d549964493
* demo: update demo * add * fix lint
55 lines
1.1 KiB
TypeScript
55 lines
1.1 KiB
TypeScript
import React from 'react';
|
|
import { Select, Space } from 'antd';
|
|
|
|
const { Option } = Select;
|
|
|
|
const handleChange = (value: string[]) => {
|
|
console.log(`selected ${value}`);
|
|
};
|
|
|
|
const App: React.FC = () => (
|
|
<Select
|
|
mode="multiple"
|
|
style={{ width: '100%' }}
|
|
placeholder="select one country"
|
|
defaultValue={['china']}
|
|
onChange={handleChange}
|
|
optionLabelProp="label"
|
|
>
|
|
<Option value="china" label="China">
|
|
<Space>
|
|
<span role="img" aria-label="China">
|
|
🇨🇳
|
|
</span>
|
|
China (中国)
|
|
</Space>
|
|
</Option>
|
|
<Option value="usa" label="USA">
|
|
<Space>
|
|
<span role="img" aria-label="USA">
|
|
🇺🇸
|
|
</span>
|
|
USA (美国)
|
|
</Space>
|
|
</Option>
|
|
<Option value="japan" label="Japan">
|
|
<Space>
|
|
<span role="img" aria-label="Japan">
|
|
🇯🇵
|
|
</span>
|
|
Japan (日本)
|
|
</Space>
|
|
</Option>
|
|
<Option value="korea" label="Korea">
|
|
<Space>
|
|
<span role="img" aria-label="Korea">
|
|
🇰🇷
|
|
</span>
|
|
Korea (韩国)
|
|
</Space>
|
|
</Option>
|
|
</Select>
|
|
);
|
|
|
|
export default App;
|