我有一个包含数据的表,当在reactJs应用程序中单击特定项目的“查看”按钮时,我需要将特定项目的数据传递给模式。
{this.state.employees.map(employee =>
<tr>
<td>1</td>
<td>{employee.firstName}</td>
<td>{employee.lastName}</td>
<td>{employee.department.name}</td>
<td>{employee.role}</td>
<td>{employee.date_of_resumption}</td>
<td><label class="switch">
<input type="checkbox"/>
<span class="slider round"></span>
</label>
</td>
<td>
<button type="submit" data-toggle="modal" data-placement="right" data-target="#customer_detail" style={{ border: '0', backgroundColor: 'white'}}><span class="view"><img src="imgs/icons/view.png" data-toggle="tooltip" data-placement="left" title="View"/></span></button>