xiaoxinzi
 1 //data为需要修改的tree,这里主要是为antd design 里面select规范数据
 2 const ass = (data) => {
 3         let item = [];
 4         data.map((list, i) => {
 5                 let newData = {};
 6                 newData.key= list.id;
 7                 newData.value = list.id;
 8                 newData.title = list.name;
 9                 newData.children = list.children  ? ass(children) : [];    //如果还有子集,就再次调用自己
10                 item.push(newData);
11         });
12         return item;
13  }

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-03-10
  • 2021-07-09
  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
猜你喜欢
  • 2022-01-28
  • 2022-12-23
  • 2021-09-24
  • 2022-12-23
  • 2021-12-23
  • 2021-08-31
相关资源
相似解决方案