user2837961
user2837961

Reputation: 1555

vue-image-upload-resize reset image file

I am using vue-image-upload-resize in my Vue project.

All works fine except I have two issues

  1. How can I remove the text near the 'choose file' button?

enter image description here

  1. How can I reset the control after file upload? Basically when I try and upload the same file again, it does not call the setImage event. I do not want to use JQuery here

Upvotes: 4

Views: 1380

Answers (1)

Suyoung Kang
Suyoung Kang

Reputation: 11

HTML:

<div class="input">
    <image-uploader></image-uploader>
</div>

CSS:

.input {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}
  1. You can use $refs

HTML:

<div class="input" @click="initiate">
    <image-uploader ref="image"></image-uploader>
</div>

JavaScript:

methods: {
    initiate() { this.$refs.image.$el.children[1].value = "" }
}

Upvotes: 1

Related Questions