import React from "react"
import Loadable from 'react-loadable';
import { Spin } from "antd";

const loadingComponent =()=>{
  return (
    <div style={{ width: '100%', textAlign: 'center' }}>
      <Spin spinning={true} style={{marginTop:'45vh'}} tip="数据加载中......" />
    </div>
  ) 
}
  
const loadable = ( loaders ) => {
  return Loadable( {
    loader: loaders,
    delay: 10000,
    timeout: 300,
    loading: loadingComponent,
  });
};

export default loadable;