content.jsx 857 B

123456789101112131415161718192021222324252627282930313233343536
  1. import React from 'react';
  2. import '../../content.less';
  3. import LeftTab from '../leftTab.jsx';
  4. import Contract from './contract.jsx';
  5. const Content = React.createClass({
  6. getInitialState() {
  7. return {
  8. loading: false,
  9. leftKey: 'contract',
  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. <Contract />
  29. </div>
  30. </div>
  31. )
  32. }
  33. });
  34. export default Content;