mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-13 07:39:10 +08:00
36 lines
617 B
TypeScript
36 lines
617 B
TypeScript
|
import React from 'react';
|
||
|
import type { MenuProps } from 'antd';
|
||
|
import { Dropdown } from 'antd';
|
||
|
|
||
|
const items: MenuProps['items'] = [
|
||
|
{
|
||
|
label: '1st menu item',
|
||
|
key: '1',
|
||
|
},
|
||
|
{
|
||
|
label: '2nd menu item',
|
||
|
key: '2',
|
||
|
},
|
||
|
{
|
||
|
label: '3rd menu item',
|
||
|
key: '3',
|
||
|
},
|
||
|
];
|
||
|
|
||
|
const App: React.FC = () => (
|
||
|
<Dropdown menu={{ items }} trigger={['contextMenu']}>
|
||
|
<div
|
||
|
className="site-dropdown-context-menu"
|
||
|
style={{
|
||
|
textAlign: 'center',
|
||
|
height: 200,
|
||
|
lineHeight: '200px',
|
||
|
}}
|
||
|
>
|
||
|
Right Click on here
|
||
|
</div>
|
||
|
</Dropdown>
|
||
|
);
|
||
|
|
||
|
export default App;
|