| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 | import React from 'react';import '../../content.less';import LeftTab from '../leftTab.jsx';import ProjectOrder from './projectOrder.jsx';import Module from '../../module.jsx'const Content = React.createClass({    getInitialState() {        return {            loading: false,            leftKey: 'myProject',        };    },    handlekey(key) {        this.setState({            leftKey: key,        });        window.location.hash = key;    },    componentWillMount(){        if ( window.location.hash ) {            this.handlekey(window.location.hash.substr(1));        };    },    render() {        return (            <div className="manage-content">                <LeftTab handlekey={this.handlekey} />                <div className="content-right">                    {(() => {                        switch (this.state.leftKey) {                            case 'myProject':                                return <ProjectOrder />;                            default:                                return <Module />;                          };                    })()}                </div>            </div>        )    }});export default Content;
 |