invoke on-change hook when file select

pull/4471/head
baiyaaaaa 2017-04-25 21:56:46 +08:00 committed by 杨奕
parent b1d74460d9
commit 74f01254b7
3 changed files with 3 additions and 2 deletions

View File

@ -358,7 +358,7 @@ on-remove | hook function when files are removed | function(file, fileList) |
on-success | hook function when uploaded successfully | function(response, file, fileList) | — | —
on-error | hook function when some errors occurs | function(err, file, fileList) | — | —
on-progress | hook function when some progress occurs | function(event, file, fileList) | — | — |
on-change | hook function when file status change | function(file, fileList) | — | — |
on-change | hook function when select file or upload file success or upload file fail | function(file, fileList) | — | — |
before-upload | hook function before uploading with the file to be uploaded as its parameter. If `false` or a `Promise` is returned, uploading will be aborted | function(file) | — | —
thumbnail-mode | whether thumbnail is displayed | boolean | — | false
file-list | default uploaded files, i.e: [{name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}] | array | — | []

View File

@ -408,7 +408,7 @@
| on-success | 可选参数, 文件上传成功时的钩子 | function(response, file, fileList) | — | — |
| on-error | 可选参数, 文件上传失败时的钩子 | function(err, file, fileList) | — | — |
| on-progress | 可选参数, 文件上传时的钩子 | function(event, file, fileList) | — | — |
| on-change | 可选参数, 文件状态改变时的钩子,上传成功或者失败时都会被调用 | function(file, fileList) | — | — |
| on-change | 可选参数, 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用 | function(file, fileList) | — | — |
| before-upload | 可选参数, 上传文件之前的钩子,参数为上传的文件,若返回 false 或者 Promise 则停止上传。 | function(file) | — | — |
| list-type | 文件列表的类型 | string | text/picture/picture-card | text |
| auto-upload | 是否在选取文件后立即进行上传 | boolean | — | true |

View File

@ -132,6 +132,7 @@ export default {
}
this.uploadFiles.push(file);
this.onChange(file, this.uploadFiles);
},
handleProgress(ev, rawFile) {
var file = this.getFile(rawFile);