一、遇到的问题
从后端接口获取的数据,需要将其渲染成树形结构
获取到的数据大概如下
Data = [
{
baseMsgCaseRule: { id: 1, name: 'wj' },
childrenList: [
{
baseMsgCaseRule: { id: 1 - 1, name: 'wjj' },
childrenList: []
},
{
baseMsgCaseRule: { id: 1 - 2, name: 'wjjj' },
childrenList: []
},
{
baseMsgCaseRule: { id: 1 - 3, name: 'wjjjj' },
childrenList: []
}
]
},
{
baseMsgCaseRule: { id: 2, name: 'ck' },
childrenList: [
{
baseMsgCaseRule: { id: 2 - 1, name: 'ckk' },
childrenList: []
},
{
baseMsgCaseRule: { id: 2 - 2, name: 'ckkk' },
childrenList: []
},
{