Minwe LUO 8 years ago
committed by 偏右
parent
commit
bbe294e96c
  1. 5
      components/upload/index.tsx
  2. 7
      components/upload/uploadList.tsx

5
components/upload/index.tsx

@ -267,12 +267,13 @@ export default class Upload extends React.Component<UploadProps, any> {
type, disabled, children, className, type, disabled, children, className,
} = this.props; } = this.props;
const rcUploadProps = assign({}, this.props, { const rcUploadProps = assign({}, {
onStart: this.onStart, onStart: this.onStart,
onError: this.onError, onError: this.onError,
onProgress: this.onProgress, onProgress: this.onProgress,
onSuccess: this.onSuccess, onSuccess: this.onSuccess,
}); }, this.props);
delete rcUploadProps.className; delete rcUploadProps.className;
const { showRemoveIcon, showPreviewIcon } = showUploadList as any; const { showRemoveIcon, showPreviewIcon } = showUploadList as any;

7
components/upload/uploadList.tsx

@ -94,9 +94,14 @@ export default class UploadList extends React.Component<UploadListProps, any> {
} }
if (file.status === 'uploading') { if (file.status === 'uploading') {
// show loading icon if upload progress listener is disabled
const loadingProgress = file.percent ? (
<Progress type="line" {...this.props.progressAttr} percent={file.percent} />
) : <Icon type="loading" />;
progress = ( progress = (
<div className={`${prefixCls}-list-item-progress`}> <div className={`${prefixCls}-list-item-progress`}>
<Progress type="line" {...this.props.progressAttr} percent={file.percent} /> {loadingProgress}
</div> </div>
); );
} }

Loading…
Cancel
Save