import React from 'react'; import { Menu, Icon } from 'antd'; import '../leftTab.less'; const SubMenu = Menu.SubMenu; const MenuItemGroup = Menu.ItemGroup; import ajax from 'jquery/src/ajax/xhr.js'; import $ from 'jquery/src/ajax'; const LeftTab = React.createClass({ getInitialState() { return { current: 'base', }; }, 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) ); }, handleClick(e) { this.props.handlekey(e.key); this.setState({ current: e.key, }); }, componentWillMount(){ this.loadData(); if ( window.location.hash ) { this.state.current = window.location.hash.substr(1); }; }, render() { return (
); }, }); export default LeftTab;