如果子级为空,将子级置为undefined,父级即可选中parent.map(item=>{
if(item.childrens.length==0){ item.childrens=undefined;
}})