原数组如下[[{"name":"VKORG","value":"1000"},{"name":"VTWEG","value":"100"},{"name":"SPART","value":"10"},{"name":"VKORGTEXT","value":"1000text"},{"name":"VTWEGTEXT","value":"100text"},{"name":"SPARTTEXT","value":"10text"}],[{"name":"VKORG","value":"1000"},{"name":"VTWEG","value":"100"},{"name":"SPART","value":"9"},{"name":"VKORGTEXT","value":"1000text"},{"name":"VTWEGTEXT","value":"100text"},{"name":"SPARTTEXT","value":"9text"}],[{"name":"VKORG","value":"1252"},{"name":"VTWEG","value":"100"},{"name":"SPART","value":"10"},{"name":"VKORGTEXT","value":"1252text"},{"name":"VTWEGTEXT","value":"100text"},{"name":"SPARTTEXT","value":"10text"}]]父子关系是动态的可配置规则展示二级或者三级嵌套如['VKORG','VTWEG','SPART']三级或者['VKORG','VTWEG']二级如果形成三级父子级数组如下[{'value':'1000','label':'1000text','children':[{'value':'100','label':'100text','children':[{'value':'10','label':'10text'},{'value':'9','label':'9text'}]}]},{'value':'1252','label':'1252text','children':[{'value':'100','label':'100text','children':[{'value':'10','label':'10text'}]}]}]如果形成二级嵌套数组如下[{'value':'1000','label':'1000text','children':[{'value':'100','label':'100text'}]},{'value':'1252','label':'1252text','children':[{'value':'100','label':'100text'}]}]请问下怎么样根据设置的嵌套层数得到以上结果###题目描述题目来源及自己的思路相关代码//请把代码文本粘贴到下方(请勿用图片代替代码)你期待的结果是什么?实际看到的错误信息又是什么?
慕哥9229398
相关分类