import React from 'react'; import { Menu, Icon } from 'antd'; import '../leftTab.less'; const SubMenu = Menu.SubMenu; const MenuItemGroup = Menu.ItemGroup; import { Link } from 'react-router'; import ajax from 'jquery/src/ajax/xhr.js'; import $ from 'jquery/src/ajax'; import { menu } from '@/account/menu'; import logo from 'img/acc-logo.png'; const LeftTab = React.createClass({ getInitialState() { return { openKeys: [ 'sub1' ], current: 'account' }; }, loadData() { $.ajax({ method: 'post', dataType: 'json', url: globalConfig.context + '/api/admin/customer/left', data: {} }).done( function(data) { if (!data.data.error.length) { this.setState({ state: data.data.aa }); } else { message.warning(data.error[0].message); } }.bind(this) ); }, menuClick(e) { this.setState({ current: e.key }); window.location.hash=e.key; }, componentWillMount() { this.loadData(); if (window.location.hash) { let current = window.location.hash.substr(2); this.setState({ current }) } }, render() { console.log(this.state.current) return (
会员中心首页
{menu.map((subMenu) => { if (subMenu.children && subMenu.children.length) { return ( {subMenu.name} } > {subMenu.children.map((menu) => ( {menu.name} ))} ); } return ( {subMenu.name} ); })}
); } }); export default LeftTab; // // 基本信息 // // // 个人资料 // // // 教育信息 // // // 职业信息 // // // 能力标签 //