1. let portalQuestionConfigDTOList = [
    2. {
    3. "title": '热门1',
    4. "portalQuestionDetailConfigDTOList": [
    5. {
    6. "customUrl": "www.aa.com",
    7. "showFlag": null,
    8. "showOrder": 0,
    9. "title": "电脑维修"
    10. }
    11. ]
    12. },
    13. {
    14. "title": '其他',
    15. "portalQuestionDetailConfigDTOList": [
    16. {
    17. "customUrl": "www.aa.com",
    18. "showFlag": null,
    19. "showOrder": 0,
    20. "title": "电脑维修2"
    21. }
    22. ]
    23. }
    24. ]
    25. let result = [];
    26. for (let i = 0; i < portalQuestionConfigDTOList.length; i++) {
    27. let titleTag = portalQuestionConfigDTOList[i].title;
    28. for (let j = 0; j < portalQuestionConfigDTOList[i].portalQuestionDetailConfigDTOList.length; j++) {
    29. let resultOne = portalQuestionConfigDTOList[i].portalQuestionDetailConfigDTOList[j];
    30. resultOne.titleTag = titleTag;
    31. result.push(resultOne);
    32. }
    33. }
    34. console.log('result', result);