【发布时间】:2017-02-12 05:52:50
【问题描述】:
我在渲染函数中有一个 const,例如 const arr = ["james","john"];
在返回函数中我这样做
<select>
arr.map(item =>
<option>item</option>
)
</select>
我在输出中看到的是项目,而不是数组的值。我错过了什么吗?我想将数组值填充为选项。
【问题讨论】:
标签: javascript reactjs ecmascript-6