2020-03-31 13:47:59 +08:00

30 lines
729 B
JavaScript

import { Component } from 'react';
export default class Base extends Component {
/* istanbul ignore next */
abort(file) {
/* istanbul ignore next */
this.uploaderRef.abort(file);
}
/* istanbul ignore next */
startUpload() {
/* istanbul ignore next */
this.uploaderRef.startUpload();
}
saveUploaderRef = ref => {
/* istanbul ignore if */
if (ref && typeof ref.getInstance === 'function') {
this.uploaderRef = ref.getInstance();
} else {
this.uploaderRef = ref;
}
};
/* istanbul ignore next */
isUploading() {
/* istanbul ignore next */
return this.uploaderRef.isUploading();
}
}