lookForAllId(data = [], arr = []) { for (let item of data) { arr.push(item.id); if (item.children && item.children.length) this.lookForAllId(item.children, arr); } return arr; },
遍历树结构数组,获取特定的值
最新推荐文章于 2024-05-18 11:09:56 发布
lookForAllId(data = [], arr = []) { for (let item of data) { arr.push(item.id); if (item.children && item.children.length) this.lookForAllId(item.children, arr); } return arr; },