2๐
โ
You must required to make a method for click on for example:
<b-button variant="danger" @click="open">Upload</b-button>
<b-form-file id="upload"></b-form-file>
<script>
export default {
methods: {
open: ()=> {document.getElementById('upload').click()},
}
}
</script>
0๐
<b-form-file
ref="signatureFile"
@input="validate(signature)"
accept=".jpeg, .jpg, .png"
v-model="signature"
class="d-none"
plain
></b-form-file>
<b-button
@click="$refs.signatureFile.$el.click();"
variant="tertiary"
>
{{ Signature ? Signature.name : 'Choose File' }}
</b-button>
Source:stackexchange.com