Tabs页面:
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import bindAll from 'lodash.bindall';
import styles from './Tabs.css';
class TabsComonents extends React.Component {
constructor (props) {
super(props);
this.state = {
visible: false,
activeKey: this.props.activeKey
};
bindAll(this,
'renderHeader',
'renderContent'
);
}
renderHeader () {
return React.Children.map(this.props.children, (element, index) => {
const activeStyle = element.key === this.state.activeKey ? "activeTitle" : null;
return (
<span
onClick={() => {this.setState({activeKey: element.key})}}
className={classNames(styles.TableTitle, ac