-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
路由处理 #3537
Comments
C 看到:
A 看到:
B 看到:
@lotherli 你想变成?: A 看到:
B 看到:
感觉结构都变了,用 meta 配置已经不够用了,思路可能是这样(没测试过): const dashboardAB: AppRouteModule[] = [
{
path: 'analysis',
name: 'Analysis',
component: () => import('/@/views/dashboard/analysis/index.vue'),
meta: {
affix: true,
title: t('routes.dashboard.analysis'),
roles:['adminA']
},
},
{
path: 'workbench',
name: 'Workbench',
component: () => import('/@/views/dashboard/workbench/index.vue'),
meta: {
title: t('routes.dashboard.workbench'),
roles:['adminB']
},
},
];
const dashboardC: AppRouteModule = {
path: '/dashboard',
name: 'Dashboard',
component: LAYOUT,
redirect: '/dashboard/analysis',
meta: {
icon: 'ion:grid-outline',
title: t('routes.dashboard.dashboard'),
roles:['adminC']
},
children: [
{
path: 'analysis',
name: 'Analysis',
component: () => import('/@/views/dashboard/analysis/index.vue'),
meta: {
affix: true,
title: t('routes.dashboard.analysis'),
},
},
{
path: 'workbench',
name: 'Workbench',
component: () => import('/@/views/dashboard/workbench/index.vue'),
meta: {
title: t('routes.dashboard.workbench'),
},
},
],
};
const 根路由数组 = [...dashboardAB, dashboardC] |
实际情况太难通用了,我项目了按业务需要,整个路由权限都重构了,路由定义99%来自于菜单管理接口,改不动原来的逻辑。 |
征集一下这个路由方案,看看咋样,不行后期修改一个demo版本,大家提issue然后一起修改😏 |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days |
假设路由下有2个页面,2个页面对应的是2个权限(前端控制权限),需要出现A用户能看到第一个页面,B用户看到第二个页面,C用户看全部,需要在左侧菜单里面显示。
我想的是A、B用户看到的左侧菜单只有一个且不需要进行折叠展开,,如果设置hideChildrenInMenu的话,AB不满足,如果设置hideMenu,不够动态化,
The text was updated successfully, but these errors were encountered: