前端树形结构递归筛选指定id的子节点 function recursion(temp(数组),id){ const newTemp = temp.filter(x => x.id !== id); newTemp.forEach(x => x.children && (x.children = this.recursion(x.children,id))) }