How can I make the file selector q-file
toggle in Quasar framework when a specific button is clicked?
My current attempt:
When this button is clicked, it should toggle the q-file
:
<button @click="toggleFileSelector">Toggle File Selector</button>
So, I have this file selector and I want it to toggle when a button is clicked:
<q-file outlined class="field" ref="myFileSelector" :label="label" v-model="myFile">
<template v-slot:append>
<div class="attachment notosanskr-medium">File</div>
</template>
</q-file>
The method for toggling:
methods: {
toggleFileSelector() {
this.$refs.myFileSelector.toggle();
},
},
However, an error occurs:
"TypeError: this.$refs.myFileSelector.toggle is not a function"