代码:

if(item2.children && item2.children.length > 0){
                            item2.children.forEach(item3=>{
                              item3.label = item3.name
                              if(item3.children.length == 0){
                                delete item3["children"]
                              }
                            })
                          }

 

posted on 2021-08-11 22:33  周文豪  阅读(157)  评论(0编辑  收藏  举报