【发布时间】:2021-04-04 19:50:56
【问题描述】:
我正在使用 Ant Design 做一个Dropdown 菜单:
import React, { Component } from "react";
import { Icon, Dropdown, Menu } from "antd";
const { Item } = Menu;
class NotificationBell extends Component {
render() {
const menu = (
<Menu>
<Item><p>You must be connected to get notifications.</p></Item>
</Menu>
);
return (
<Dropdown overlay={menu} trigger={['click']}>
<Icon type="bell" theme="outlined" />
</Dropdown>
);
}
}
这是我得到的:
但我不想只删除突出显示,我还想让组件不可点击,即我想要一个“普通光标”而不是“手形光标”。
按照the Ant Design documentation 的建议在Menu 组件上添加selectable={false} 属性无济于事。我该怎么办?
感谢您的帮助。
【问题讨论】:
标签: css reactjs drop-down-menu antd