export const routeSort = (routeList:any):AppRouteRecordRaw => {
    const list:AppRouteRecordRaw = routeList;
    let temp:any;
    for(let i:number = 0;i<routeList.length;i++){
        if(routeList[i].children){
            routeList[i].children = routeSort(routeList[i].children);
        }
    }
    for(let i:number = 0;i<routeList.length;i++){
        for(let j:number = i+1;j<routeList.length;j++){
            if(routeList[i]?.meta?.sort > routeList[j]?.meta?.sort){
                temp = list[i];
                list[i] = list[j];
                list[j] = temp;
            }
        }
    }
    
    return list
}
