react的map循环嵌套

var btnType=Object.keys(obj).map((key,i)=>{
    var item=obj[key].map((s,index)=>{
      return (
        <button className={styles.btnType} key={index}>{obj[key][index]}</button>
      )
    })
    return(
      <Card title={key} className={styles.marginB10} key={i}>
        {item}
      </Card> 
    )
  })

猜你喜欢

转载自blog.csdn.net/hahahhahahahha123456/article/details/81661661