refactor: 移除 Loading 组件

This commit is contained in:
力皓 2020-12-10 10:36:57 +08:00
parent 3ee5fba476
commit cc33fecf27
4 changed files with 59 additions and 59 deletions

View File

@ -2,7 +2,7 @@ import React, { Component, PureComponent, createElement as reactCreateElement }
import ReactDOM from 'react-dom';
import PropTypes from 'prop-types';
import Debug from 'debug';
import { ConfigProvider } from '@alifd/next';
import ConfigProvider from '@alifd/next/lib/config-provider';
import { isEmpty } from '@ali/b3-one/lib/obj';
import AppContext from './context/appContext';
import { isFileSchema, goldlog } from './utils';

View File

@ -2,8 +2,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import Debug from 'debug';
import classnames from 'classnames';
import Loading from '@alifd/next/lib/loading';
import '@alifd/next/lib/loading/style';
// import Loading from '@alifd/next/lib/loading';
// import '@alifd/next/lib/loading/style';
import BaseRenderer from './base';
import AppContext from '../context/appContext';
import { isSchema, getFileCssName } from '../utils';
@ -114,23 +114,23 @@ export default class BlockRenderer extends BaseRenderer {
</AppContext.Provider>
);
if (autoLoading || loading !== undefined) {
return (
<Loading
size="medium"
visible={!!(this.__showPlaceholder || loading)}
style={{
height: this.__showPlaceholder ? defaultHeight : 'auto',
display: 'block',
...style,
}}
className={classnames('luna-block', getFileCssName(__schema.fileName), className, this.props.className)}
id={id}
>
{!this.__showPlaceholder && renderContent()}
</Loading>
);
}
// if (autoLoading || loading !== undefined) {
// return (
// <Loading
// size="medium"
// visible={!!(this.__showPlaceholder || loading)}
// style={{
// height: this.__showPlaceholder ? defaultHeight : 'auto',
// display: 'block',
// ...style,
// }}
// className={classnames('luna-block', getFileCssName(__schema.fileName), className, this.props.className)}
// id={id}
// >
// {!this.__showPlaceholder && renderContent()}
// </Loading>
// );
// }
return (
<div

View File

@ -2,8 +2,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import Debug from 'debug';
import classnames from 'classnames';
import Loading from '@alifd/next/lib/loading';
import '@alifd/next/lib/loading/style';
// import Loading from '@alifd/next/lib/loading';
// import '@alifd/next/lib/loading/style';
import AppContext from '../context/appContext';
import BaseRenderer from './base';
import { isSchema, getFileCssName } from '../utils';
@ -98,23 +98,23 @@ export default class CompRenderer extends BaseRenderer {
if (noContainer) {
return renderContent();
}
if (autoLoading || loading !== undefined) {
return (
<Loading
size="medium"
visible={!!(this.__showPlaceholder || loading)}
style={{
height: this.__showPlaceholder ? defaultHeight : 'auto',
display: 'block',
...style,
}}
className={classnames('luna-comp', getFileCssName(__schema.fileName), className, this.props.className)}
id={this.props.id || id}
>
{!this.__showPlaceholder && renderContent()}
</Loading>
);
}
// if (autoLoading || loading !== undefined) {
// return (
// <Loading
// size="medium"
// visible={!!(this.__showPlaceholder || loading)}
// style={{
// height: this.__showPlaceholder ? defaultHeight : 'auto',
// display: 'block',
// ...style,
// }}
// className={classnames('luna-comp', getFileCssName(__schema.fileName), className, this.props.className)}
// id={this.props.id || id}
// >
// {!this.__showPlaceholder && renderContent()}
// </Loading>
// );
// }
return (
<div
ref={this.__getRef}

View File

@ -2,8 +2,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import Debug from 'debug';
import classnames from 'classnames';
import Loading from '@alifd/next/lib/loading';
import '@alifd/next/lib/loading/style';
// import Loading from '@alifd/next/lib/loading';
// import '@alifd/next/lib/loading/style';
import AppContext from '../context/appContext';
import BaseRenderer from './base';
import { isSchema, getFileCssName } from '../utils';
@ -77,7 +77,7 @@ export default class PageRenderer extends BaseRenderer {
this.state = this.__parseData(__schema.state || {});
this.__bindCustomMethods(this.props);
this.__initDataSource(this.props);
// this.__setLifeCycleMethods('constructor', arguments);
this.__generateCtx({
@ -126,23 +126,23 @@ export default class PageRenderer extends BaseRenderer {
</AppContext.Provider>
);
if (autoLoading || loading !== undefined) {
return (
<Loading
size="medium"
visible={!!(this.__showPlaceholder || loading)}
style={{
height: this.__showPlaceholder ? defaultHeight : 'auto',
display: 'block',
...style,
}}
className={classnames('luna-page', getFileCssName(__schema.fileName), className, this.props.className)}
id={id}
>
{!this.__showPlaceholder && renderContent()}
</Loading>
);
}
// if (autoLoading || loading !== undefined) {
// return (
// <Loading
// size="medium"
// visible={!!(this.__showPlaceholder || loading)}
// style={{
// height: this.__showPlaceholder ? defaultHeight : 'auto',
// display: 'block',
// ...style,
// }}
// className={classnames('luna-page', getFileCssName(__schema.fileName), className, this.props.className)}
// id={id}
// >
// {!this.__showPlaceholder && renderContent()}
// </Loading>
// );
// }
return (
<div