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; },
遍历树结构数组,获取特定的值
最新推荐文章于 2023-03-23 16:53:36 发布
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; },