老师为什么不给出这样的数据结构而是给出两个列表数据,既不方便前端理解,又不方便前端使用
[
{
"id": 1,
"name": "鞋",
"description": null,
"is_root": true,
"parent_id": null,
"img": "http://i2.sleeve.7yue.pro/u2.png",
"index": 3,
"online": 1,
"level": null,
"items": [
{
"id": 6,
"name": "平底鞋",
"description": null,
"is_root": false,
"parent_id": 1,
"img": "http://i2.sleeve.7yue.pro/u4.png",
"index": null,
"online": 1,
"level": null
},
{
"id": 7,
"name": "凉鞋",
"description": null,
"is_root": false,
"parent_id": 1,
"img": "http://i2.sleeve.7yue.pro/u5.png",
"index": null,
"online": 1,
"level": null
},
{
"id": 8,
"name": "拖鞋",
"description": null,
"is_root": false,
"parent_id": 1,
"img": "http://i2.sleeve.7yue.pro/u6.png",
"index": null,
"online": 1,
"level": null
},
{
"id": 9,
"name": "运动鞋",
"description": null,
"is_root": false,
"parent_id": 1,
"img": "http://i2.sleeve.7yue.pro/u4.png",
"index": null,
"online": 1,
"level": null
},
{
"id": 10,
"name": "高跟鞋",
"description": null,
"is_root": false,
"parent_id": 1,
"img": "http://i2.sleeve.7yue.pro/u5.png",
"index": null,
"online": 1,
"level": null
}
]
},
{
"id": 2,
"name": "服装",
"description": null,
"is_root": true,
"parent_id": null,
"img": "http://i2.sleeve.7yue.pro/u3.png",
"index": 2,
"online": 1,
"level": null,
"items": [
{
"id": 11,
"name": "衬衫",
"description": null,
"is_root": false,
"parent_id": 2,
"img": "http://i2.sleeve.7yue.pro/u5.png",
"index": null,
"online": 1,
"level": null
},
{
"id": 12,
"name": "T恤",
"description": null,
"is_root": false,
"parent_id": 2,
"img": "http://i2.sleeve.7yue.pro/u4.png",
"index": null,
"online": 1,
"level": null
},
{
"id": 13,
"name": "牛仔裤",
"description": null,
"is_root": false,
"parent_id": 2,
"img": "http://i2.sleeve.7yue.pro/u5.png",
"index": null,
"online": 1,
"level": null
},
{
"id": 14,
"name": "针织衫",
"description": null,
"is_root": false,
"parent_id": 2,
"img": "http://i2.sleeve.7yue.pro/u6.png",
"index": null,
"online": 1,
"level": null
},
{
"id": 15,
"name": "连衣裙",
"description": null,
"is_root": false,
"parent_id": 2,
"img": "http://i2.sleeve.7yue.pro/u6.png",
"index": null,
"online": 1,
"level": null
},
{
"id": 16,
"name": "风衣",
"description": null,
"is_root": false,
"parent_id": 2,
"img": "http://i2.sleeve.7yue.pro/u5.png",
"index": null,
"online": 1,
"level": null
}
]
},
{
"id": 3,
"name": "包包",
"description": null,
"is_root": true,
"parent_id": null,
"img": "http://i2.sleeve.7yue.pro/u3.png",
"index": 1,
"online": 1,
"level": null,
"items": [
{
"id": 17,
"name": "手包",
"description": null,
"is_root": false,
"parent_id": 3,
"img": "http://i2.sleeve.7yue.pro/u6.png",
"index": null,
"online": 1,
"level": null
},
{
"id": 18,
"name": "旅行包",
"description": null,
"is_root": false,
"parent_id": 3,
"img": "http://i2.sleeve.7yue.pro/u4.pn",
"index": null,
"online": 1,
"level": null
},
{
"id": 19,
"name": "单肩包",
"description": null,
"is_root": false,
"parent_id": 3,
"img": "http://i2.sleeve.7yue.pro/u5.png",
"index": null,
"online": 1,
"level": null
}
]
},
{
"id": 4,
"name": "居家",
"description": null,
"is_root": true,
"parent_id": null,
"img": "http://i2.sleeve.7yue.pro/u2.png",
"index": 5,
"online": 1,
"level": null,
"items": [
{
"id": 20,
"name": "收纳",
"description": null,
"is_root": false,
"parent_id": 4,
"img": "http://i2.sleeve.7yue.pro/u4.png",
"index": null,
"online": 1,
"level": null
},
{
"id": 21,
"name": "毛巾",
"description": null,
"is_root": false,
"parent_id": 4,
"img": "http://i2.sleeve.7yue.pro/u5.png",
"index": null,
"online": 1,
"level": null
},
{
"id": 22,
"name": "四件套",
"description": null,
"is_root": false,
"parent_id": 4,
"img": "http://i2.sleeve.7yue.pro/u6.png",
"index": null,
"online": 1,
"level": null
},
{
"id": 23,
"name": "台灯",
"description": null,
"is_root": false,
"parent_id": 4,
"img": "http://i2.sleeve.7yue.pro/u4.png",
"index": null,
"online": 1,
"level": null
}
]
},
{
"id": 5,
"name": "饰品",
"description": null,
"is_root": true,
"parent_id": null,
"img": "http://i2.sleeve.7yue.pro/u2.png",
"index": 4,
"online": 1,
"level": null,
"items": [
{
"id": 36,
"name": "酷玩",
"description": null,
"is_root": false,
"parent_id": 5,
"img": "http://i2.sleeve.7yue.pro/u5.png",
"index": null,
"online": 1,
"level": null
},
{
"id": 39,
"name": "束带",
"description": null,
"is_root": false,
"parent_id": 5,
"img": "http://i2.sleeve.7yue.pro/u4.png",
"index": null,
"online": 1,
"level": null
}
]
},
{
"id": 24,
"name": "工艺",
"description": null,
"is_root": true,
"parent_id": null,
"img": "http://i2.sleeve.7yue.pro/u3.png",
"index": 1,
"online": 1,
"level": null,
"items": [
{
"id": 32,
"name": "文具",
"description": null,
"is_root": false,
"parent_id": 24,
"img": "http://i2.sleeve.7yue.pro/u6.png",
"index": null,
"online": 1,
"level": null
}
]
},
{
"id": 37,
"name": "测试数据",
"description": null,
"is_root": true,
"parent_id": null,
"img": "http://i2.sleeve.7yue.pro/u2.png",
"index": null,
"online": 1,
"level": null,
"items": [
{
"id": 38,
"name": "测试数据",
"description": null,
"is_root": false,
"parent_id": 37,
"img": "http://i2.sleeve.7yue.pro/u5.png",
"index": null,
"online": 1,
"level": null
}
]
}
]
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星