let data1=[ { isShow:true, children:[ { isShow:true, nodeName:'天天下级文件夹', children:[ { isShow:true, nodeName:'天天下下级文件夹', children:[] }, { isShow:false, nodeName:'天天下下级文件夹2', children:[] }, ] }, { isShow:false, nodeName:'lala', children:[] } ], nodeName:'天天文件夹', }, { isShow:true, nodeName:'一样', children:[] }, { isShow:false, nodeName:'不一样', children:[] } ] 想要改造成以下这种 let data2=[ { isShow:true, children:[ { isShow:true, nodeName:'天天下级文件夹', children:[ { isShow:true, nodeName:'天天下下级文件夹', children:[] }, ] }, ], nodeName:'天天文件夹', }, { isShow:true, nodeName:'一样', children:[] }, ]