import React, { Component } from 'react'; import router from 'umi/router'; import { connect } from 'dva'; import { Input } from 'antd'; import PageHeaderWrapper from './components/PageHeaderWrapper'; interface PAGE_NAME_UPPER_CAMEL_CASEProps { match: { url: string; path: string; }; location: { pathname: string; }; } @connect() class PAGE_NAME_UPPER_CAMEL_CASE extends Component { handleTabChange = (key: string) => { const { match } = this.props; const url = match.url === '/' ? '' : match.url; switch (key) { case 'articles': router.push(`${url}/articles`); break; case 'applications': router.push(`${url}/applications`); break; case 'projects': router.push(`${url}/projects`); break; default: break; } }; handleFormSubmit = (value: string) => { // tslint:disable-next-line: no-console console.log(value); }; getTabKey = () => { const { match, location } = this.props; const url = match.path === '/' ? '' : match.path; const tabKey = location.pathname.replace(`${url}/`, ''); if (tabKey && tabKey !== '/') { return tabKey; } return 'articles'; }; render() { const tabList = [ { key: 'articles', tab: '文章', }, { key: 'projects', tab: '项目', }, { key: 'applications', tab: '应用', }, ]; const mainSearch = (
); const { children } = this.props; return ( {children} ); } } export default PAGE_NAME_UPPER_CAMEL_CASE;