content.jsx 866 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import React from 'react';
  2. import '../../content.less';
  3. import LeftTab from '../leftTab.jsx';
  4. import Copyright from './copyright.jsx';
  5. const Content = React.createClass({
  6. getInitialState() {
  7. return {
  8. loading: false,
  9. leftKey: 'comprehensive',
  10. };
  11. },
  12. handlekey(key) {
  13. this.setState({
  14. leftKey: key,
  15. });
  16. window.location.hash = key;
  17. },
  18. componentWillMount(){
  19. if ( window.location.hash ) {
  20. this.handlekey(window.location.hash.substr(1));
  21. };
  22. },
  23. render() {
  24. return (
  25. <div className="manage-content">
  26. <LeftTab handlekey={this.handlekey} />
  27. <div className="content-right">
  28. <Copyright />
  29. </div>
  30. </div>
  31. )
  32. }
  33. });
  34. export default Content;