mirror of https://github.com/ElemeFE/element
Upload: use uid as upload-list key (#13054)
* Upload: use uid as upload-list key * chore: fix code stylepull/12858/merge
parent
9bbae74cb6
commit
0de8a032c0
|
@ -85,11 +85,10 @@
|
|||
},
|
||||
clearValidate(props = []) {
|
||||
const fields = props.length
|
||||
? (typeof props === 'string'
|
||||
? this.fields.filter(field => props === field.prop)
|
||||
: this.fields.filter(field => props.indexOf(field.prop) > -1)
|
||||
)
|
||||
: this.fields;
|
||||
? (typeof props === 'string'
|
||||
? this.fields.filter(field => props === field.prop)
|
||||
: this.fields.filter(field => props.indexOf(field.prop) > -1)
|
||||
) : this.fields;
|
||||
fields.forEach(field => {
|
||||
field.clearValidate();
|
||||
});
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
name="el-list"
|
||||
>
|
||||
<li
|
||||
v-for="(file, index) in files"
|
||||
v-for="file in files"
|
||||
:class="['el-upload-list__item', 'is-' + file.status, focusing ? 'focusing' : '']"
|
||||
:key="index"
|
||||
:key="file.uid"
|
||||
tabindex="0"
|
||||
@keydown.delete="!disabled && $emit('remove', file)"
|
||||
@focus="focusing = true"
|
||||
|
@ -65,6 +65,9 @@
|
|||
import ElProgress from 'element-ui/packages/progress';
|
||||
|
||||
export default {
|
||||
|
||||
name: 'ElUploadList',
|
||||
|
||||
mixins: [Locale],
|
||||
|
||||
data() {
|
||||
|
|
Loading…
Reference in New Issue