[英]Reactjs Ant-Design Menu - change subMenu appearance
I'm developing a Reactjs website and I'm using Ant-Design (antd) library. 我正在开发一个Reactjs网站,并且正在使用Ant-Design(antd)库。 I have a Menu and I decided to use the vertical mode.
我有一个菜单,我决定使用垂直模式。 Since my website has rtl layout, I need the SubMenu items to be opened in the left side of the Menu box.
由于我的网站具有rtl布局,因此我需要在“菜单”框的左侧打开“子菜单”项。 How can I do that?
我怎样才能做到这一点?
I've prepared an image of what I really want to do: 我已经准备好了我真正想做的图像:
This is my code: 这是我的代码:
<Layout className="SideMenus">
<Menu mode="vertical" defaultSelectedKeys={['One']}>
<Menu.Item key="One">One</Menu.Item>
<Menu.Item key="Two">Two</Menu.Item>
<SubMenu key="Three" title="Three">
<Menu.Item key="Option3">Option3</Menu.Item>
<Menu.Item key="Option4">Option4</Menu.Item>
</SubMenu>
</Layout>
If there is no space on the right, the menu will be automatically opened in the left side. 如果右侧没有空间,则菜单将在左侧自动打开。
Have you tried vertical-right
mode? 您是否尝试过
vertical-right
模式? I couldn't really try it, but maybe it is what you are looking for ... 我真的不能尝试,但是也许这就是您想要的...
在菜单级样式中使用向右浮动,它将自动弹出子菜单左侧
<Menu onClick={handleClick} style={{ width: 256 , float : "right"}} mode="vertical">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.