将树结构转化为水平列表 function treeToList(list) { let res = [] for (const item of list) { const { childList, ...i } = item if (childList && childList.length) { res = res.concat(treeToList(childList)) } res.push(i) } return res }