需求:对后台返回的数据做处理。返回的数组中,第一个对象的value:[11,21,42],但是children中id不包含42,应该用数组中移除,最终value:[11,21]。同理,第二个数组中 value:[42]
后台返回格式:
[
{
"children": [
{
"id": 11,
"typeName": "水果类"
},
{
"id": 21,
"typeName": "水果类"
}
],
"title": "水果类",
"value": [11,21,42]
},
{
"children": [
{
"id": 42,
"typeName": "展示类"
}
],
"title": "展示类",
"value": [11,21,42]
}
慕村225694
相关分类