蚂蚁设计:将位置子菜单移至屏幕顶部
可以将子菜单位置移至屏幕顶部。我正在使用新的菜单组件。以哪种方式使用它是使用它,您要做的就是写<菜单模式= {mode} theme = {theme} items = {items}/>
。
蓝线是菜单,红线是子菜单。我以前的方式是创建一个新菜单并将其放在屏幕顶部 但是我认为,如果您这样使用它,那将是很多麻烦。因此,我想通过将子菜单移至屏幕顶部来切换方式。真的可以做吗?
It is possible to move sub menu position to top of the screen. I am using the new menu component. Which way to declare it is to use it, all you have to do is write <Menu mode= {mode} theme={theme} items={items}/>
.
And this is my expected condition:
The blue line is menu, and the red line is submenu. The way I did before was to create a new menu and place it at the top of the screen
But I think it will be a lot of trouble if you use it that way. So I want to switch ways by moving the sub menu to the top of the screen. Is that really possible to do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您始终可以覆盖蚂蚁设计CSS样式来实现这一目标。子菜单项是通常的
ul
&amp;li
对。要在我们只需要的行中显示li
项目 -我们可以将其应用于Ant Design菜单项&amp;一些调整 -
nofollow noreferrer“>
= a href =“ https://i.sstatic.net/co3db.png” rel =“ nofollow noreferrer”>
You can always override the ant design css styles to achieve this. The sub menu items are the usual
ul
&li
pair. To displayli
items in a line we just need to -We can apply the same to ant design menu items & a few tweaks -
Output
“ popupoffset”在项目阵列中更新此param键以设置其弹出偏移量
"popupOffset" update this param key in the items array for the respective item to set its popup offset