Home > front end >  JS tree structure data filtering
JS tree structure data filtering

Time:09-21

[{
Id: '1',
Childern: [{
Id: '2',
Children: [{
Id: '9',
Flag: true
}, {
Id: '10'
}]
}]
},
{
Id: '3',
Childern: [{
Id: '4',
Flag: true,
Children: [{
Id: '5'
}, {
Id: '6'
}]
}]
}]
How to filter the data above as it only contains the following data flag to true data, structure cannot destroy
[{
Id: '1',
Childern: [{
Id: '2',
Children: [{
Id: '9',
Flag: true
}]
}]
},
{
Id: '3',
Childern: [{
Id: '4',
Flag: true,
Children: [{
Id: '5'
}, {
Id: '6'
}]
}]
}]

CodePudding user response:

http://biwen.csdn.net
  • Related