mirror of https://github.com/ElemeFE/element
Ensure inner el-upload uses name attribute (#3940)
In order to avoid confusion when posting the form using regular non-xhr requests. Also do not clear input value after `handleChange` event.pull/4080/head
parent
190abd647b
commit
9c21be25e7
|
@ -59,7 +59,6 @@ export default {
|
|||
|
||||
if (!files) return;
|
||||
this.uploadFiles(files);
|
||||
this.$refs.input.value = null;
|
||||
},
|
||||
uploadFiles(files) {
|
||||
let postFiles = Array.prototype.slice.call(files);
|
||||
|
@ -126,6 +125,7 @@ export default {
|
|||
let {
|
||||
handleClick,
|
||||
drag,
|
||||
name,
|
||||
handleChange,
|
||||
multiple,
|
||||
accept,
|
||||
|
@ -148,7 +148,7 @@ export default {
|
|||
? <upload-dragger on-file={uploadFiles}>{this.$slots.default}</upload-dragger>
|
||||
: this.$slots.default
|
||||
}
|
||||
<input class="el-upload__input" type="file" ref="input" on-change={handleChange} multiple={multiple} accept={accept}></input>
|
||||
<input class="el-upload__input" type="file" ref="input" name={name} on-change={handleChange} multiple={multiple} accept={accept}></input>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue