mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-23 23:18:36 +08:00
39 lines
633 B
TypeScript
39 lines
633 B
TypeScript
|
import React from 'react';
|
||
|
import { DownOutlined } from '@ant-design/icons';
|
||
|
import type { MenuProps } from 'antd';
|
||
|
import { Dropdown, Space, Typography } from 'antd';
|
||
|
|
||
|
const items: MenuProps['items'] = [
|
||
|
{
|
||
|
key: '1',
|
||
|
label: 'Item 1',
|
||
|
},
|
||
|
{
|
||
|
key: '2',
|
||
|
label: 'Item 2',
|
||
|
},
|
||
|
{
|
||
|
key: '3',
|
||
|
label: 'Item 3',
|
||
|
},
|
||
|
];
|
||
|
|
||
|
const App: React.FC = () => (
|
||
|
<Dropdown
|
||
|
menu={{
|
||
|
items,
|
||
|
selectable: true,
|
||
|
defaultSelectedKeys: ['3'],
|
||
|
}}
|
||
|
>
|
||
|
<Typography.Link>
|
||
|
<Space>
|
||
|
Selectable
|
||
|
<DownOutlined />
|
||
|
</Space>
|
||
|
</Typography.Link>
|
||
|
</Dropdown>
|
||
|
);
|
||
|
|
||
|
export default App;
|