https://blog.csdn.net/suwyer/article/details/81481507(copy)

<div style={{display: (index===this.state.currentIndex) ? "block" : "none"}}>此标签是否隐藏</div>
<div style={{display: (index===this.state.currentIndex) ? "block" : "none", color:"red"}}>此标签是否隐藏</div>
<div className={index===this.state.currentIndex?"active":null}>此标签是否选中</div>
<div className={`container tab ${index===this.state.currentIndex?"active":null}`}>此标签是否选中</div>

最好一种推荐使用

相关文章:

  • 2022-12-23
  • 2022-02-16
  • 2022-01-14
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
  • 2022-02-03
  • 2021-08-11
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2021-10-30
  • 2022-01-23
相关资源
相似解决方案