update
This commit is contained in:
@ -30,26 +30,6 @@ const convertToDashedString = (input: string): string => {
|
||||
return `/${parts.join('-')}`;
|
||||
}
|
||||
|
||||
// export const convertRouteToMenu = (data: RouteRecordRaw[], basePath: string = '/home', iconIndex: number = 0): MenuItemModel[] => {
|
||||
// return data.filter((i) => i.path !== '').map((item) => {
|
||||
// const convertedItem: MenuItemModel = {
|
||||
// name: item.name?.toString() || '',
|
||||
// path: convertToDashedString(`${basePath}/${item.path}`).replace('/home-', '/home/'),
|
||||
// expanded: false,
|
||||
// icon: undefined,
|
||||
// children: [],
|
||||
// };
|
||||
|
||||
// if (item.children) {
|
||||
// convertedItem.icon = navigationIcon[iconIndex];
|
||||
// iconIndex = (iconIndex + 1) % navigationIcon.length;
|
||||
// convertedItem.children = convertRouteToMenu(item.children, `${basePath}/${item.path}`, iconIndex);
|
||||
// }
|
||||
|
||||
// return convertedItem
|
||||
// })
|
||||
// }
|
||||
|
||||
export const convertRouteToMenu = (data: RouteRecordRaw[], basePath: string = '/home', iconIndex: number = 0): MenuItemModel[] => {
|
||||
return data.filter((i) => i.path !== '').map((item) => {
|
||||
const convertedItem: MenuItemModel = {
|
||||
|
Reference in New Issue
Block a user