in src/router/layer.ts [21:84]
function layerDashboards() {
const appStore = useAppStoreWithOut();
const routes = appStore.allMenus.map((item: MenuOptions) => {
const route: any = {
path: "",
name: item.name,
component: Layout,
meta: {
icon: item.icon || "cloud_queue",
title: item.title,
hasGroup: item.hasGroup,
activate: item.activate,
descKey: item.descKey,
i18nKey: item.i18nKey,
},
children: item.subItems && item.subItems.length ? [] : undefined,
};
for (const child of item.subItems || []) {
const d = {
name: child.name,
path: child.path,
meta: {
title: child.title,
layer: child.layer,
icon: child.icon || "cloud_queue",
activate: child.activate,
descKey: child.descKey,
i18nKey: child.i18nKey,
},
component: () => import("@/views/Layer.vue"),
};
route.children.push(d);
const tab = {
name: `${child.name}ActiveTabIndex`,
path: `/${child.name}/tab/:activeTabIndex`,
component: () => import("@/views/Layer.vue"),
meta: {
notShow: true,
layer: child.layer,
},
};
route.children.push(tab);
}
if (!item.hasGroup) {
route.children = [
{
name: item.name,
path: item.path,
meta: {
title: item.title,
layer: item.layer,
icon: item.icon,
activate: item.activate,
descKey: item.descKey,
i18nKey: item.i18nKey,
},
component: () => import("@/views/Layer.vue"),
},
];
}
return route;
});
return routes;
}