let arr=[{ title:'1', key:'1', type:0, children:[{ title:'1-1', key:'1-1', type:0, }] },{ title:'2', key:'2', type:0, children:[] },{ title:'3', key:'3', type:0, children:[{ title:'3-1', key:'3', type:0, }] },{ title:'4', key:'4', type:1, children:[]…