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 (
); } }); export default LeftTab; //