mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-19 11:58:41 +08:00
45 lines
758 B
TypeScript
45 lines
758 B
TypeScript
|
import React from 'react';
|
||
|
import { DownOutlined, SettingOutlined } from '@ant-design/icons';
|
||
|
import type { MenuProps } from 'antd';
|
||
|
import { Dropdown, Space } from 'antd';
|
||
|
|
||
|
const items: MenuProps['items'] = [
|
||
|
{
|
||
|
key: '1',
|
||
|
label: 'My Account',
|
||
|
disabled: true,
|
||
|
},
|
||
|
{
|
||
|
type: 'divider',
|
||
|
},
|
||
|
{
|
||
|
key: '2',
|
||
|
label: 'Profile',
|
||
|
extra: '⌘P',
|
||
|
},
|
||
|
{
|
||
|
key: '3',
|
||
|
label: 'Billing',
|
||
|
extra: '⌘B',
|
||
|
},
|
||
|
{
|
||
|
key: '4',
|
||
|
label: 'Settings',
|
||
|
icon: <SettingOutlined />,
|
||
|
extra: '⌘S',
|
||
|
},
|
||
|
];
|
||
|
|
||
|
const App: React.FC = () => (
|
||
|
<Dropdown menu={{ items }}>
|
||
|
<a onClick={(e) => e.preventDefault()}>
|
||
|
<Space>
|
||
|
Hover me
|
||
|
<DownOutlined />
|
||
|
</Space>
|
||
|
</a>
|
||
|
</Dropdown>
|
||
|
);
|
||
|
|
||
|
export default App;
|