【问题标题】:how to get data from json and display in the table如何从json中获取数据并显示在表格中
【发布时间】:2019-04-02 05:33:18
【问题描述】:
const CustomerInfo = [
    { id: "1", value: "9940572756", lastRecharge: "349", lastCallDuration: "09:58", lastCalledNumber: "9478369258", status: "Active" },
    { id: "2", value: "9874563210", lastRecharge: "110", lastCallDuration: "01:01:13", lastCalledNumber: "9632587410", status: "In Active" },
    { id: "3", value: "9517530258", lastRecharge: "500", lastCallDuration: "02:40", lastCalledNumber: "9362580147", status: "Active" }
]

我需要将其显示在我有提交按钮的表单中,并且还需要在将值作为电话号码调用时将其显示在表格中

【问题讨论】:

  • 你在这里有什么问题?您希望我们帮助您创建一个显示这些客户信息的表格吗?
  • 希望你能在下面的链接Already answered找到解决办法

标签: json reactjs react-redux


【解决方案1】:

渲染() {

return (
  <table>
  <tbody>{this.CustomerInfo.map(function(item, key) {

           return (
              <tr key = {key}>
                  <td>{item.id}</td>
                  <td>{item.value}</td>
                  <td>{item.lastRecharge}</td>
                  <td>{item.lastCallDuration}</td>
                  <td>{item.lastCalledNumber}</td>
              </tr>
            )

         })}</tbody>
   </table>
)

}

【讨论】:

    猜你喜欢
    • 2019-08-19
    • 2022-07-21
    • 2015-02-17
    • 1970-01-01
    • 2021-03-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多