本文主要是介绍React Tabs 标签 组件,附源码,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
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 (<spanonClick={() => {this.setState({activeKey: element.key})}}className={classNames(styles.TableTitle, ac
这篇关于React Tabs 标签 组件,附源码的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!