/**
 * 按需加载
 */
import React from "react";
import Loadable from 'react-loadable';
import styles from './component.css';
const MyLoadingComponent = ({ isLoading, error }) => {
    if (isLoading) {
        return <div className={styles.error}>
            <i className={"iconfont icon-load "+styles.loading}></i>
            页面加载中……
        </div>
    }
    else if (error) {
        return <div className={styles.error}>
            <i className={"iconfont icon-jiazaishibai"}></i>
            页面加载失败!
        </div>
    }
    else {
        return null;
    }
};
export default {
    //态势
    "/situation":Loadable({
        loader: () => import("../pages/Situation"),
        loading: MyLoadingComponent
    }),
    //园区分布
    "/distributed":Loadable({
        loader: () => import("../pages/Distributed/index.jsx"),
        loading: MyLoadingComponent
    }),
    //产业扶贫
    "/industry":Loadable({
        loader: () => import("../pages/Industry/index.jsx"),
        loading: MyLoadingComponent
    }),
    //现状
    "/Analysis":Loadable({
        loader: () => import("../pages/Analysis/index.js"),
        loading: MyLoadingComponent
    }),    
}