1、引入组件
2、state中设置选中状态
// button按钮的默认选中,0代表选中
state = {
currentIndex: 0
}
3、设置class的样式,点击更改选中

selectNew(){
this.setState({currentIndex:0});
}
selectOld(){
this.setState({currentIndex:1});
}
1、引入组件
2、state中设置选中状态