react table里跳转页面_如何在react中实现一个table切换?
生活随笔
收集整理的這篇文章主要介紹了
react table里跳转页面_如何在react中实现一个table切换?
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
廢話不說,直接貼代碼,供新手參考
export default class TabComponent extends Component {
constructor(props){
super(props);
this.state = {
};
}
render(){
return (
第一部分
第二部分
第三部分
);
}
}
上面是一個組件
constructor(props) {
super(props);
this.state = {
coutype: 0
}
}
itemNav = (index) => {
return index === this.state.coutype ? ‘active‘ : ‘‘;
}
{ this.state.couponBar.map((element,index) => { return (
{ this.setState({ coutype: index }) } } className={ this.itemNav(index) } key={index}>{ element } ) }) }
總結
以上是生活随笔為你收集整理的react table里跳转页面_如何在react中实现一个table切换?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: c++读二进制文件结束的时候总会异常_p
- 下一篇: 复制百度文库的文字加什么后缀_WORD文