react添加多个className

<div className={`title ${index == this.state.index ? 'active' : ''}`}></div>

title为固定样式,active为条件渲染

posted @ 2020-02-26 22:51  panchunxin  阅读(1236)  评论(0)    收藏  举报