/** * Created by ZN on 2018/5/03. * 可配置属性: * show:为true是才显示,false不显示 * text:显示在图标下的文字 * img:自定义图标 */ import React, {Component} from 'react'; /*import PropTypes from 'prop-types';*/ import style from './index.less'; import wnIcon from '@common/images/wn.png'; import icon from '@common/images/loading.gif'; import Notify from '@commonComp/Notify'; import ReactDom from 'react-dom'; /*const propTypes = { text: PropTypes.string, show: PropTypes.bool, shadeIsShow: PropTypes.bool }; const defaultProps = { text: '拼命加载中...', shadeIsShow: true };*/ // function Loading(props) { // const {text, img, show} = props; // return ( //
// {props.shadeIsShow?
:''} //
// //

{text}

//
//
// ) // } class Loading extends React.Component{ render(){ const {text,show,type} = this.props; const domNode = document.getElementById('root'); return ReactDom.createPortal(
{/*{this.props.shadeIsShow?
:null}*/}
{type==='warning'?Notify.info(text,0, false,false):

{text}

}
,domNode ) } } export default Loading;