【发布时间】:2021-04-19 06:38:04
【问题描述】:
我有这个代码
{categories.map((category, index) => {
return(
<option value={category._id} key={index}>{category.name}</option>
)
})}
此代码显示所有类别。我有const product
如果product.category == category._id添加属性selected到select(在map函数中)怎么做
【问题讨论】:
标签: reactjs