【发布时间】:2020-10-10 02:11:19
【问题描述】:
谁能在这里发现问题?
import React from 'react'
export default function CoinTable(props){
props.data.map(row=> {
console.log(row.first_name)
})
return (
<table>
<thead>
<tr>
<th>Name</th>
<th>Phone</th>
<th>Email</th>
<th>Subscription</th>
</tr>
</thead>
<tbody>
{
props.data.map(row => {
<tr>
<td>{row.first_name} {row.last_name}</td>
<td>{row.phone}</td>
<td>{row.email}</td>
</tr>
})
}
</tbody>
</table>
)
}
由于某种原因,代码出现在控制台上,但没有出现在屏幕上。如果有帮助,我也会从 JSON 文件中打印。
【问题讨论】:
-
在第二张地图中,如果你把console.log(row)放在控制台上会打印什么?
-
你能显示你为
data赋值的代码吗?
标签: html next.js tailwind-css