首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在席表中显示下拉列表,然后根据类型记录中的下拉选项显示其他列?

如何在席表中显示下拉列表,然后根据类型记录中的下拉选项显示其他列?
EN

Stack Overflow用户
提问于 2022-08-09 06:25:18
回答 1查看 31关注 0票数 1

假设这是我的api响应-

我需要使用for循环将followUpLists分配给FollowList数组吗?如何在类型记录中编码for循环?

代码语言:javascript
复制
{
  "Info": [
    {
      "CustomerId": "3",
      "CustomerName": "Sreejesh Panayappilly ",
      "followUpLists": [
        {
          "CustomerId": "3",
          "CustomerName": "Sreejesh Panayappilly ",
          "ProductName": "OLT - GPON - V1600G0 - 4 PON PORT",
          "MacId": "14A72BA2AFF2",
          "AMCStartDate": "0001-01-01T00:00:00",
          "AMCEndDate": "0001-01-01T00:00:00",
          "AMCStatus": 1,
          "FollowStatus": 0
        },
        {
          "CustomerId": "3",
          "CustomerName": "Sreejesh Panayappilly ",
          "ProductName": "OLT - GPON - V1600G1 (B) - 8 PON PORT",
          "MacId": "14A72BF09C40",
          "AMCStartDate": "0001-01-01T00:00:00",
          "AMCEndDate": "0001-01-01T00:00:00",
          "AMCStatus": 1,
          "FollowStatus": 0
        }
      ]
    },
    {
      "CustomerId": "5",
      "CustomerName": "Priyamvadan",
      "followUpLists": [
        {
          "CustomerId": "5",
          "CustomerName": "Priyamvadan",
          "ProductName": "OLT - GPON - V1600G1 (B) - 8 PON PORT",
          "MacId": "14A72BF09B8C",
          "AMCStartDate": "0001-01-01T00:00:00",
          "AMCEndDate": "0001-01-01T00:00:00",
          "AMCStatus": 1,
          "FollowStatus": 1
        }
      ]
    },
 ],
  "Status": true,
  "Message": "Data Collected Successfully."
}

我需要使用for循环将followUpLists数组分配给FollowList数组吗?如何在类型记录中编码for循环?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-08-09 06:41:11

也许试一试:

代码语言:javascript
复制
const FollowList = [];
yourObject.Info.map(e => FollowList.push(...e.followUpLists));
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73287343

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档