Closed aifuxi closed 5 months ago
修复 #16
types/entity.ts
Permission
hideTab
src/_mock/assets.js
true
src/router/hooks/use-permission-routes.tsx
src/layouts/dashboard/nav.tsx
window.open
https://github.com/d3george/slash-admin/assets/65325004/71d47820-7772-460b-8f47-8fd0da8f632a
点击外链菜单时会:
https://github.com/d3george/slash-admin/assets/65325004/a53f184a-e7b8-4170-a364-31087cff7b12
点击外链菜单时只会打开新标签页
fix/hide-in-multi-tab
git clone -b fix/hide-in-multi-tab https://github.com/aifuxi/slash-admin.git
# 安装依赖 pnpm install # 启动开发环境 pnpm dev
http://localhost:3001
The latest updates on your projects. Learn more about Vercel for Git ↗︎
修复 #16
改动点
types/entity.ts
中Permission
接口新增hideTab
字段src/_mock/assets.js
中配置返回的外链菜单配置的hideTab
字段为true
src/router/hooks/use-permission-routes.tsx
中,返回hideTab
字段src/layouts/dashboard/nav.tsx
中处理菜单的onClick时,判断当前点击的菜单是否为外链以及hideTab
字段是否为true
;是外链并且hideTab
字段为true
,使用window.open
打开外链同时项目内不进行路由跳转Before
https://github.com/d3george/slash-admin/assets/65325004/71d47820-7772-460b-8f47-8fd0da8f632a
点击外链菜单时会:
After
https://github.com/d3george/slash-admin/assets/65325004/a53f184a-e7b8-4170-a364-31087cff7b12
点击外链菜单时只会打开新标签页
如何验证:
fix/hide-in-multi-tab
分支代码http://localhost:3001
进行验证,如果已登录,务必先退出登录后,再重新登录,防止接口有缓存