const recursionRemoveEmpty = (data) => {
data = data.filter((item) => {
if (item.children) item.children = recursionRemoveEmpty(item.children);
if (item.children && item.children.length === 0) delete item.children;
return item;
});
return data;
}
级联框数据递归判断去掉空的children
最新推荐文章于 2024-08-26 16:38:21 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)