data:[
{
title: "",
isOpen: true,
children: [
{
title: "",
isOpen: true,
children: [
{
title: "",
isOpen: false,
},{
title: "",
isOpen: false,
}
]
},
{
title: "",
isOpen: false,
children: [
{
title: "",
isOpen: false,
}, {
title: "",
isOpen: false,
}
]
}
]
},
{
title: "",
isOpen: false,
children: [
{
title: "",
isOpen: false,
}, {
title: "",
isOpen: false,
}
]
},
{
title: "",
isOpen: false,
}
]
the original data is as above
output rule:
if the upper isOpen:true, then process its children data, and put the children data into a separate array, insert it into the big tree group, and so on.
the basic output structure is as follows
[[,],[,],[,]]