'How to open folder to change uploaded photo in 'vue-upload-component'
I have vue-upload-component. I need to show uploaded images and show on every image button for changing it (Upload new image).
What should be in uploadNew method? How to open browse folder for new image?
<div>
<file-upload
:ref="uploaderName"
v-model="files"
:input-id="uploaderName"
:extensions="formats"
:drop="drop"
:multiple="multiple"
@input-filter="inputFilter"
>
Upload a file
</file-upload>
<span>or drag and drop</span>
</div>
after that
<div
v-show="files.length && !loading"
class="flex"
>
<img
v-for="image in files"
:key="image.id"
:src="image.url"
:style="[imageSize]"
class="uploaded-image p-2 mr-2 border rounded border-gray-200"
>
<button @click='uploadNew'>
Upload new
</button>
<button @click='clearUploader'>
Remove
</button>
</div>
and data
methods: {
clearUploader() {
this.$refs[this.uploaderName].clear();
},
uploadNew() {
},
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
