sxfad / react-admin

基于 Ant Design React 的管理系统架构
https://sxfad.github.io/react-admin
608 stars 169 forks source link

列表页跳转详情页,当刷新页面菜单不选中 #154

Open zakihong opened 7 months ago

zakihong commented 7 months ago

@config({ path: '/flows/:id', selectedMenuPath: '/flows', side: true, title: { text: '详情' }, })

zkboys commented 7 months ago

菜单配置中需要有个一个 /flows 相关的菜单,比如 {id: 2, parentId: 1, title: '菜单名称', path: '/flows', order: 900, type: 1},

zakihong commented 7 months ago

已经配置了,{ menuId: 40, menuName: '发布单', menuPath: '/flows', pMenuId: 4, }, { menuId: 44, menuName: '发布单详情', menuPath: '/flows/:id', pMenuId: 4, type: 1, }, 刷新详情页面的时候,左侧菜单既不展开也不选中,怎么解决,求指导

zkboys commented 7 months ago

左侧菜单是你自定义了吗?还是用框架自带的? 我这里无法复现,是不存在这个问题的

image
zakihong commented 7 months ago

我是定义了一个MenuConfig{ menuId: 4, menuName: '变更管理', menuPath: '', pMenuId: 0, subs: [ { menuId: 40, menuName: '发布单', menuPath: '/flows', pMenuId: 4, }, { menuId: 44, menuName: '发布单详情', menuPath: '/flows/:id', pMenuId: 4, type: 1, }, { menuId: 41, menuName: '变更登记', menuPath: '/history', pMenuId: 4, }, { menuId: 42, menuName: '变更日志', menuPath: '/logs', pMenuId: 4, }, ], },然后在App.js中转成{ id: node.menuId, order: 100 - i, type: 1, parentKey: ${node.pMenuId}, key: ${node.menuId}, text: node.menuName, path: node.menuPath, }这样

zakihong commented 7 months ago

我使用的你之前很早的框架 image

zkboys commented 7 months ago

@ra-lib/xxx的库可以尝试更新一下

zakihong commented 7 months ago

我用的@ra-lib