方法一:ES6 模板字符串 ``
className={`title ${index === this.state.active ? 'active' : ''}`}
方法二:join("")
className={["title", index === this.state.active?"active":null].join(' ')}