1.
2.
3. 将树状结构转为list
export function treeToList(data) { let tmp = [] data.forEach((one) => { tmp.push(Object.assign({}, one)) if (one.children && one.children.length > 0) { const children = treeToList(one.children) if (children) { tmp = tmp.concat(children) } } }) return tmp}