import React, { MouseEvent } from 'react'; import SButton from '@components/SButton'; import SIcon from '@components/SIcon'; import SCell from '@components/SCell'; import SInput from '@components/SInput'; import { number } from 'prop-types'; import service from './service'; interface IProps { title?: string; history: any; } interface IState { count: number; } class Home extends React.PureComponent { public constructor(props: IProps) { super(props); this.state = { count: 0 }; this.navigateTo = this.navigateTo.bind(this); } public render() { const datas = service.getMenuDatas(); const listCells = datas.map(item => { return ( this.navigateTo(item.path)}>); }); return (
{/* home {this.state.count} */} {/* */} {listCells} {/* */}
); } private navigateTo(path: string): void { this.props.history.push(path); } } export default Home;