leftTabgroup.jsx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import React from 'react';
  2. import { Menu, Icon } from 'antd';
  3. import '../leftTab.less';
  4. const SubMenu = Menu.SubMenu;
  5. const MenuItemGroup = Menu.ItemGroup;
  6. const LeftTab = React.createClass({
  7. getInitialState() {
  8. return {
  9. current: 'group',
  10. };
  11. },
  12. handleClick(e) {
  13. this.props.handlekey(e.key);
  14. this.setState({
  15. current: e.key,
  16. });
  17. },
  18. componentWillMount(){
  19. if ( window.location.hash ) {
  20. this.state.current = window.location.hash.substr(1);
  21. };
  22. },
  23. render() {
  24. return (
  25. <Menu onClick={this.handleClick}
  26. selectedKeys={[this.state.current]}
  27. mode="vertical"
  28. className="account-left"
  29. >
  30. <Menu.Item key="group">
  31. 基本信息
  32. </Menu.Item>
  33. <Menu.Item key="company">
  34. 单位资料
  35. </Menu.Item>
  36. <Menu.Item key="tech">
  37. 技术能力
  38. </Menu.Item>
  39. <Menu.Item key="ablt">
  40. 能力标签
  41. </Menu.Item>
  42. <Menu.Item key="hrSituation">
  43. 人力状况
  44. </Menu.Item>
  45. </Menu>
  46. );
  47. },
  48. });
  49. export default LeftTab;