Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧐[问题 | question]路由菜单想做成这样子的,请各路大神帮忙看看 #11074

Closed
yang-chuanjiang opened this issue Dec 4, 2023 · 2 comments

Comments

@yang-chuanjiang
Copy link

🧐 问题描述 | Problem description

1701658125621

** 二级路由想水平放置,目前都是垂直摆放的

@chenshuai2144
Copy link
Collaborator

问题描述中提到想将二级路由的菜单水平放置,目前是垂直摆放的。这个问题的解决方案是使用水平布局的导航栏组件。

你可以使用 antd 库中的 Menu 组件来实现这个效果。设置 mode 属性为 'horizontal',即可将菜单项水平排列。

以下是一个示例代码:

<Menu mode="horizontal">
  <Menu.Item key="1">菜单项 1</Menu.Item>
  <Menu.Item key="2">菜单项 2</Menu.Item>
  <Menu.Item key="3">菜单项 3</Menu.Item>
</Menu>

你可以将你的路由配置与具体菜单项对应起来,这样就可以在菜单中展示你的路由导航了。

希望这个回答对你有帮助!如果还有其他问题,请随时提问。

@chenshuai2144
Copy link
Collaborator

根据上面的嵌套一下吧,不然会很复杂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants