fix(components): [upload] onPreview not work when picture list type (#9448)

This commit is contained in:
zz 2022-08-28 00:32:07 +08:00 committed by GitHub
parent ec311634f9
commit eed57636e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 10 deletions

View File

@ -33,15 +33,12 @@
alt=""
/>
<div
v-if="
listType !== 'picture' &&
(file.status === 'uploading' || listType !== 'picture-card')
"
v-if="file.status === 'uploading' || listType !== 'picture-card'"
:class="nsUpload.be('list', 'item-info')"
>
<a
:class="nsUpload.be('list', 'item-name')"
@click.prevent="handleClick(file)"
@click.prevent="handlePreview(file)"
>
<el-icon :class="nsIcon.m('document')"><Document /></el-icon>
<span :class="nsUpload.be('list', 'item-file-name')">
@ -128,7 +125,7 @@ defineOptions({
name: 'ElUploadList',
})
const props = defineProps(uploadListProps)
defineProps(uploadListProps)
const emit = defineEmits(uploadListEmits)
const { t } = useLocale()
@ -138,10 +135,6 @@ const nsList = useNamespace('list')
const focusing = ref(false)
const handleClick = (file: UploadFile) => {
props.handlePreview(file)
}
const handleRemove = (file: UploadFile) => {
emit('remove', file)
}

View File

@ -440,6 +440,8 @@
box-sizing: border-box;
margin-top: 10px;
padding: 10px;
display: flex;
align-items: center;
.#{bem('icon', '' ,'check')},
.#{bem('icon', '' ,'circle-check')} {