【发布时间】:2018-01-27 14:06:21
【问题描述】:
我在 Cell 属性中使用 Select 时遇到问题 我试过这段代码。在 console.log 循环工作并在 val 中有值但没有渲染选项来选择
{
Header: "last update",
id : "appoint",
accessor: "appoint",
Cell: row => (
<select>
{
row.row.appoint.map((val,key)=>{
<option value={val.work_start_date_full}>val.work_text</option>
})
}
</select>)
}
然后我尝试了。它 。循环工作(在 console.log 中尝试)但显示 val 未定义
{
Header: "last update",
id : "appoint",
accessor: "appoint",
Cell: row => (
<select>
row.row.appoint.map((val,key)=>{
<option value={val.work_start_date_full}>val.work_text</option>
})
</select>
)
}
指定示例数据
appoint : [
{work_no : xxxx, work_txt:"xxxxxxxxxxxx' },
{work_no : yyyy, work_txt:"yyyyyyyyyyyy' },
]
【问题讨论】:
标签: reactjs react-table