function findNodeTemplateEnable(groupList, id){
let children;
let back;
//循环
for(let i=0; i<groupList.length; i++){
children = 'children' in groupList[i] && groupList[i].children && groupList[i].children.length;
//找到需要的值
if(groupList[i].id == id){
back = groupList[i];
break;
} else{
if(children){
let temp = findNodeTemplateEnable(groupList[i].children, id);
if (temp){
back = temp;
break;
}
}
}
}
return back;
}

被折叠的 条评论
为什么被折叠?



