我是反应新手。如何使用“map”函数在两列中列出两个不同数组的元素?
state = {
dates: ["2000", "2001", "2002"],
cases: ["1", "2", "3"]
}
render() {
return (
<thead>
<tr>
<th>Date</th>
<th>Cases</th>
</tr>
</thead>
<tbody>
{this.state.dates.map(el =>
<tr>
<td>{el}</td>
</tr>
)} // I want to list elements from "cases" array like this but in the second column
</tbody>
)
}
米脂
慕尼黑的夜晚无繁华
相关分类