Skip to content

Commit

Permalink
update uploader
Browse files Browse the repository at this point in the history
  • Loading branch information
nelyaklyusa committed May 29, 2024
1 parent f54686e commit 01a2627
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/BaseUploader/BaseUploader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const drop = (e: DragEvent) => {
const removeFile = (index: number) => {
allFiles.value.splice(index, 1);
filesUploadError.value = '';
emit('update:files', allFiles.value);
emit('remove', index);
};
</script>
Expand All @@ -90,6 +91,7 @@ const removeFile = (index: number) => {
@dragover.prevent="dragover"
@dragleave.prevent="dragleave"
@drop.prevent="drop"
@click="triggerFileInput"
>
<input
id="file-control"
Expand Down Expand Up @@ -146,7 +148,7 @@ const removeFile = (index: number) => {
<div
class="base-uploader__preview-card-remove"
title="Remove file"
@click="removeFile(index)"
@click.stop="removeFile(index)"
>
<b>×</b>
</div>
Expand Down Expand Up @@ -193,6 +195,10 @@ const removeFile = (index: number) => {
&.is--disabled
opacity: 0.3
&:hover
border-color: $primary
cursor: pointer
input[type="file"]
opacity: 0
overflow: hidden
Expand All @@ -209,6 +215,8 @@ const removeFile = (index: number) => {
&__preview
width: 100%
position: relative
z-index: 1
&__preview-card
width: 100%
Expand Down

0 comments on commit 01a2627

Please sign in to comment.