三按钮组件的完成
<ul className="radiobtn wradiobtn">
<li className={this.state.act? "" : "active"} onClick={this.chargeType}>报告类</li>
<li className={this.state.act? "active" : ""} onClick={this.chargeType}>接口类</li>
<li className={this.state.act? "active" : ""} onClick={this.chargeType}>分析类</li>
</ul>
其中
① this.state.act = "";
②
chargeType:function (e) {
if(e.target.getAttribute('class')==""){
var activenodelist =document.getElementsByClassName("active");
activenodelist[0].setAttribute('class','');
e.target.setAttribute('class','active');
}
}