"this.$refs.fileinput.reset is not a function"
See original GitHub issueI can’t seem to clear my b-form-file
inputs.
I’ve tried everything, including this.$refs.fileinput.reset()
, which returns “this.$refs.fileinput.reset is not a function” in firefox and chrome. Every other attempt simply does nothing.
Relevent code:
<b-form-group v-b-tooltip.hover title="Files">
<b-form-file multiple placeholder="Upload files" ref="fileinput" type="file" v-model="files"/>
<b-button @click="clearFiles">Reset</b-button>
</b-form-group>
export default {
data() {
return {
files: [];
};
},
methods: {
clearFiles() {
this.$refs.fileinput.reset();
},
},
};
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
How to reset/clear file Input - vue.js - Stack Overflow
inputFile.reset is not a function when I use this, but using this.$refs.inputFile.value=null worked for me.
Read more >Child and $refs not a function - Laracasts
I'm calling the saveData() method from the parent like so. Copy Code saveItem() { this.$refs.actionInput.saveData(); },.
Read more >This.$refs.form.validate is not a function - Get Help - Vue Forum
this.$refs.form[0].validate(); It's because may be you are using the component in a loop, so it's giving you a array if $refs. Try using...
Read more >Form component — Vuetify
reset () will clear all inputs and reset their validation errors. this.$refs.form.resetValidation() will only reset input validation and not alter their state.
Read more >V-File-Input .Click() Is Not A Function - ADocLib
refs.form.reset() Expected Behavior As the docs says, reset() will Resets validation for ... Will help fallback to a normal HTML file input for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Probably not. You may need to place the dev branch bootstrap-vue outside of node_modules, and do an import from that local directory (after building).
Ah, that is because we introduced the option to always have the navbar collapsed (acceptance of boolean true on toggleable prop). May need to update the docs.