index.js 725 Bytes
import React from 'react';
import { Route, Switch } from "react-router";
import asyncComponent from '../AsyncComponent';

//首页
const HomeContainer = asyncComponent(
    () => import(/* webpackChunkName: "home" */'../../containers/home')
);
//统计
const StatisticsContainer = asyncComponent(
    () => import(/* webpackChunkName: "home" */'../../containers/home/StatisticsContainer')
);

const homeRoute = (match) => {
    return (
        <Switch>
            {/* 首页 */}
            <Route exact={true} path={`${match.path}/home`} component={HomeContainer} />
            <Route exact={true} path={`${match.path}/statistics`} component={StatisticsContainer} />
        </Switch>
    );
};

export default homeRoute;