树型结构转一维List

树形结构转一维 list原始数据const data = [ { name: "a", children: [ { name: "a1", children: [ {


一维List转树形结构

一维 list 生成树行结构原始数据let datas = [ { id: 0, parentId: null, name: "一级菜单A", rank: 1 }, { id: 1, parentId: 0, name: "一级菜单A", rank: 1