{
"364": {
"data": {
"id": 364,
"pid": 0,
"level": 0,
"path": "-0-",
"type": 1,
"title": "工程技术",
"description": "",
"icon": "",
"sort": 0,
"add_time": "0000-00-00 00:00:00",
"update_time": "2022-02-17 17:38:41",
"is_hid": 0,
"is_del": "0"
},
"child": {
"378": {
"data": {
"id": 378,
"pid": 364,
"level": 1,
"path": "-0-364-",
"type": 1,
"title": "关键设备/部件",
"description": "",
"icon": "",
"sort": 0,
"add_time": "0000-00-00 00:00:00",
"update_time": "2022-02-17 17:38:52",
"is_hid": 0,
"is_del": "0"
},
"child": {
"383": {
"data": {
"id": 383,
"pid": 378,
"level": 2,
"path": "-0-364-378-",
"type": 1,
"title": "反应釜",
"description": "",
"icon": "",
"sort": 0,
"add_time": "0000-00-00 00:00:00",
"update_time": "2022-03-23 11:15:35",
"is_hid": 0,
"is_del": "0"
},
"child": []
}
}
},
}
},
"365": {
"data": {
"id": 365,
"pid": 0,
"level": 0,
"path": "-0-",
"type": 1,
"title": "维护保养",
"description": "",
"icon": "",
"sort": 0,
"add_time": "0000-00-00 00:00:00",
"update_time": "0000-00-00 00:00:00",
"is_hid": 0,
"is_del": "0"
},
"child": {
"376": {
"data": {
"id": 376,
"pid": 365,
"level": 1,
"path": "-0-365-",
"type": 1,
"title": "动设备",
"description": "",
"icon": "",
"sort": 0,
"add_time": "0000-00-00 00:00:00",
"update_time": "0000-00-00 00:00:00",
"is_hid": 0,
"is_del": "0"
},
"child": []
},
"377": {
"data": {
"id": 377,
"pid": 365,
"level": 1,
"path": "-0-365-",
"type": 1,
"title": "静设备",
"description": "",
"icon": "",
"sort": 0,
"add_time": "0000-00-00 00:00:00",
"update_time": "0000-00-00 00:00:00",
"is_hid": 0,
"is_del": "0"
},
"child": []
}
}
}
}
怎么通过js递归实现跟element-UI这种数据格式?
https://segmentfault.com/q/10...
可以参考下这个简单版本, 原理差不多, 都是递归