how to add data with a tree structure to an id value. The rule is that the last bit of id in children is the last bit of parent id + 1
[ //
{
value: "",
id: "0",
children: [
{
value: "",
id: "0.1",
children: [
{
value: "A",
id: "0.1.2",
children: [
{
id:"0.1.2.3",
value: ""
}
]
},
{
value: "B",
id: "0.1.3",
children: [
{ id:"0.1.3.4",
value: ""
}
]
},
{
value: "C",
id:"0.1.4",
children: [
{
value: "",
id:"0.1.4.5",
}
]
},
]
},
{ id: "0.2",value: "" },
{ id: "0.3",value: "" }
]
},
{
value: "",
id: "1",
children: [
{
value: "",id: "1.2"
children: [
{
value: "A",
id:"1.2.3",
}
]
},
{
value: "",id: "1.3",
children: [
{
value: "A",
id:"1.3.4",
}
]
}
]
}
]