javascript - Antd下拉悬停问题
问题描述
我正在使用DropDown
ant设计库并循环遍历DropDown
数组。悬停动作仅适用于最后一项。代码如下:这catNavItems
是一个array
. 例如['Furniture', 'Cushions', 'Blankets']
{_.map(catNavItems, function(item, key){
return <Dropdown
overlayClassName="shop-navigation cat-nav"
overlay={catMenu}
trigger={["hover"]}
onVisibleChange={() => handleVisibleChangeCat(!catNavVisible, item)}
getPopupContainer={(trigger) => trigger.parentElement}
visible={catNavVisible}
overlayStyle={{ width: "100%", cursor: "pointer" }}
>
<div
className={
catNavColor
? "shop my-account-header qa-cursor qa-hover"
: "shop my-account-header qa-cursor"
}
style={{
verticalAlign: "middle",
marginLeft: "20px",
marginRight: "20px",
height: "40px",
lineHeight: "40px",
}}
// onClick={() => {
// router.push("/products/all-categories");
// }}
>
{item}
</div>
</Dropdown>
})}
请建议是否有人可以在这里提供帮助。提前致谢 :)
解决方案
推荐阅读
- java - ONNX 的 JavaCPP 预设:不支持平台“windows-x86_64”
- swift - 在 SwiftUI 的 LinkPresentation 框架中的函数中返回 LPMetadataProvider 的图像
- java - 是否可以使用 java 将 .mdf 文件转换为 csv?
- python - Python直接制作一个变化的numpy数组的电影
- python - python -- 在没有管理员权限的情况下手动安装下载的模块
- node.js - 针对 ejs 渲染错误的 Nodejs Express Ejs 应用程序错误捕获
- c# - C# 将 xml 粘贴为类:缺少样式表
- javascript - 如何呈现 ColumnChart 滑块
- c++ - (为什么)std::binomial_distribution 对大概率 p 有偏差,而对小 n 则慢?
- c# - 较新机器上的 USB 通信问题