forked from react-component/dropdown
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontext-menu.jsx
More file actions
35 lines (32 loc) · 725 Bytes
/
context-menu.jsx
File metadata and controls
35 lines (32 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import Dropdown from '@rc-component/dropdown';
import Menu, { Item as MenuItem } from '@rc-component/menu';
import React from 'react';
import '../../assets/index.less';
function ContextMenu() {
const menu = (
<Menu style={{ width: 140 }}>
<MenuItem key="1">one</MenuItem>
<MenuItem key="2">two</MenuItem>
</Menu>
);
return (
<Dropdown
trigger={['contextMenu']}
overlay={menu}
animation="slide-up"
alignPoint
>
<div
role="button"
style={{
border: '1px solid #000',
padding: '100px 0',
textAlign: 'center',
}}
>
Right click me!
</div>
</Dropdown>
);
}
export default ContextMenu;