Skip to content

Commit

Permalink
fix(components): [upload] onPreview not work when picture list ty…
Browse files Browse the repository at this point in the history
…pe (#9448)
  • Loading branch information
holazz committed Aug 27, 2022
1 parent ec31163 commit eed5763
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
13 changes: 3 additions & 10 deletions packages/components/upload/src/upload-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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')">
Expand Down Expand Up @@ -128,7 +125,7 @@ defineOptions({
name: 'ElUploadList',
})
const props = defineProps(uploadListProps)
defineProps(uploadListProps)
const emit = defineEmits(uploadListEmits)
const { t } = useLocale()
Expand All @@ -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)
}
Expand Down
2 changes: 2 additions & 0 deletions packages/theme-chalk/src/upload.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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')} {
Expand Down

0 comments on commit eed5763

Please sign in to comment.