|
@@ -10,6 +10,7 @@ import React, {Component} from 'react';
|
|
|
import style from './index.less';
|
|
|
// import icon from './img/loading.gif';
|
|
|
import icon from '@common/images/loading.gif';
|
|
|
+import ReactDom from 'react-dom';
|
|
|
|
|
|
/*const propTypes = {
|
|
|
text: PropTypes.string,
|
|
@@ -37,7 +38,8 @@ const defaultProps = {
|
|
|
class Loading extends React.Component{
|
|
|
render(){
|
|
|
const {text,show} = this.props;
|
|
|
- return (
|
|
|
+ const domNode = document.getElementById('root');
|
|
|
+ return ReactDom.createPortal(<React.Fragment>
|
|
|
<div className={style['loading']} style={{display: show ? 'block' : 'none'}}>
|
|
|
{/*{this.props.shadeIsShow?<div className={style['cover']}/>:null}*/}
|
|
|
<div className={style['cover']}/>
|
|
@@ -46,6 +48,7 @@ class Loading extends React.Component{
|
|
|
<p>{text}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ </React.Fragment>,domNode
|
|
|
)
|
|
|
}
|
|
|
}
|