Bind file input to a button using Vue.js
You can do this:
HTML:
<input id="fileUpload" type="file" hidden>
<button @click="chooseFiles()">Choose</button>
Vue.js:
methods: {
chooseFiles: function() {
document.getElementById("fileUpload").click()
},
...
EDIT - Update syntax:
methods: {
chooseFiles() {
document.getElementById("fileUpload").click()
},
...
Simplest way to do this is to stylize a label element like a button, HTML only.