ant-design/components/dropdown/demo/context-menu.md
xrkffgg dcc0ffa016
chore : prettier code (#29123)
* style: prettier code

* update

* Update index.less
2021-01-30 19:39:02 +08:00

981 B

order title
8
zh-CN en-US
右键菜单 Context Menu

zh-CN

默认是移入触发菜单,可以点击鼠标右键触发。

en-US

The default trigger mode is hover, you can change it to contextMenu.

import { Menu, Dropdown } from 'antd';

const menu = (
  <Menu>
    <Menu.Item key="1">1st menu item</Menu.Item>
    <Menu.Item key="2">2nd menu item</Menu.Item>
    <Menu.Item key="3">3rd menu item</Menu.Item>
  </Menu>
);

ReactDOM.render(
  <Dropdown overlay={menu} trigger={['contextMenu']}>
    <div
      className="site-dropdown-context-menu"
      style={{
        textAlign: 'center',
        height: 200,
        lineHeight: '200px',
      }}
    >
      Right Click on here
    </div>
  </Dropdown>,
  mountNode,
);
.site-dropdown-context-menu {
  color: #777;
  background: #f7f7f7;
}