Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

Commit

Permalink
fix(Upload): onUplading to onUploading
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimi-Gao committed Apr 26, 2020
1 parent e3dad5a commit 3ad6871
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/Upload/docs/Upload.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class UploadFile extends React.Component {
const props = {
method: 'post',
action: '/upload.do',
onUplading: this.handleUploading,
onUploading: this.handleUploading,
onComplete: this.handleComplete,
multiple: true,
showFileList: true
Expand Down
14 changes: 7 additions & 7 deletions src/components/Upload/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ class Upload extends React.Component {
handleChange = event => {
const el = event.target
const files = el.files
const onUplading = this.props.onUplading
const onUploading = this.props.onUploading
const onUpload = this.props.onUpload
onUplading && onUplading(0)
onUploading && onUploading(0)
onUpload ? onUpload(files) : this.upload(files)
el.value = ''
}

upload (files) {
const onUplading = this.props.onUplading
const onUploading = this.props.onUploading
const self = this
const arr = []
for (let i = 0; i < files.length; i++) {
Expand All @@ -59,7 +59,7 @@ class Upload extends React.Component {
const list = self.state.list.slice(0)
const f = list[index]
f.percent = per
onUplading && onUplading(per)
onUploading && onUploading(per)
self.setState({
list
})
Expand Down Expand Up @@ -117,7 +117,7 @@ class Upload extends React.Component {
action,
fileName,
multiple,
onUplading,
onUploading,
onComplete,
showFileList,
button,
Expand Down Expand Up @@ -175,11 +175,11 @@ Upload.propTypes = {
/** The name of uploaded file, default value is `files` */
fileName: PropTypes.string,

/** Whether to support multi-selection, ie10+ supports, press ctrl can select multi files after enabled */
/** Whether to support multi-selection, ie10+ supports, press ctrl can select multi files after enabled */
multiple: PropTypes.bool,

/** The callback of the progress of uploading */
onUplading: PropTypes.func,
onUploading: PropTypes.func,

onUpload: PropTypes.func,

Expand Down

0 comments on commit 3ad6871

Please sign in to comment.