HTML
<input type="file" @change="tirggerFile($event)">
JS(vue-methods)
tirggerFile : function (event) { var file = ; // (Use the output to see the structure to know how to process archives) // do something... }
If this is passed directly into the bound function, it cannot be obtained correctly and the relevant inputfile object cannot be obtained.
PS: The following is a brief introduction to how to bind src in img tags using input file in vue
<img v-bind:src="lmodel"> <input v-model="lmodel" type="file">
ps: v-on:change="xxx", v-on="change:xxx".
The former is the current writing style, and the latter is the abandoned writing style.
Summarize
The above is the perfect implementation method for obtaining the currently uploaded object by the editor to vue input file binding function. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time. Thank you very much for your support for my website!