support Progress & Upload
support Progress & Upload
This commit is contained in:
parent
c97c42ab2e
commit
5d08ddf27c
10 changed files with 137 additions and 63 deletions
|
@ -7,9 +7,9 @@
|
|||
@dragover.prevent="dragOver = true"
|
||||
@dragleave.prevent="dragOver = false">
|
||||
<input
|
||||
v-el:input
|
||||
:class="[prefixCls + '-input']"
|
||||
ref="input"
|
||||
type="file"
|
||||
:class="[prefixCls + '-input']"
|
||||
@change="handleChange"
|
||||
:multiple="multiple"
|
||||
:accept="accept">
|
||||
|
@ -154,7 +154,7 @@
|
|||
},
|
||||
methods: {
|
||||
handleClick () {
|
||||
this.$els.input.click();
|
||||
this.$refs.input.click();
|
||||
},
|
||||
handleChange (e) {
|
||||
const files = e.target.files;
|
||||
|
@ -163,7 +163,7 @@
|
|||
return;
|
||||
}
|
||||
this.uploadFiles(files);
|
||||
this.$els.input.value = null;
|
||||
this.$refs.input.value = null;
|
||||
},
|
||||
onDrop (e) {
|
||||
this.dragOver = false;
|
||||
|
@ -276,7 +276,8 @@
|
|||
_file.status = 'finished';
|
||||
_file.response = res;
|
||||
|
||||
this.$dispatch('on-form-change', _file);
|
||||
// todo 事件
|
||||
// this.$dispatch('on-form-change', _file);
|
||||
this.onSuccess(res, _file, this.fileList);
|
||||
|
||||
setTimeout(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue