A
A
Andre972021-11-02 11:46:09
Vue.js
Andre97, 2021-11-02 11:46:09

How to activate vue-upload-component via third party button?

Good afternoon. It is necessary to make it so that when you click on the button, the file is given for uploading. Found such third party component for vue.js vue-upload-component. You can make a button inside it, but it doesn’t fit a little. It is necessary to somehow "pull" it from another button. The documentation has an example of how to do this at the link, something like this:

<file-upload
    ref="upload"
    v-model="files"
    post-action="/post.method"
    put-action="/put.method"
    @input-file="inputFile"
    @input-filter="inputFilter"
  >
  </file-upload>


  <v-btn @click.prevent="$refs.upload.active = true">
        Загрузить файл
  </v-btn>

but for some reason it doesn't work. What is wrong and how to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2021-11-02
@Fragster

If you need to open a file selection dialog, then you can only do this:

<label for="id_инпута_файла" class="стиль_чтобы_выглядела_как_кнопка">Содержимое "кнопки"</label>

and the script will not work at all

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question