Reinit project

This commit is contained in:
Limo Saplf
2019-08-31 20:44:15 +08:00
commit b51ae824c7
115 changed files with 20955 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
/**
* Routes:
* - ./src/pages/routes
*/
import React from 'react';
import { connect, DispatchProp } from 'dva';
import { RouterTypes, Redirect } from 'umi';
import Tab from '@/components/Tab';
import styles from './style.less';
import { HomeModelState } from './model';
const HomePage: React.FC<RouterTypes & DispatchProp & HomeModelState> = ({
dispatch,
tabItems,
selectedTab,
location: { pathname },
children,
}) => {
if (pathname === '/home') return <Redirect to="/home/home" />
return (
<div className={styles.home}>
<section className={styles.page}>
{children}
</section>
<footer className={styles.tab}>
<Tab
items={tabItems}
selectedKey={selectedTab}
onChange={payload => dispatch({ type: 'home/changeTab', payload })}
/>
</footer>
</div>
);
}
export default connect(
({ home }: any) => ({ ...home }),
)(HomePage);