0👍
I found a solution that seems to work in this case. The problem seems to be that when the form is cleared it activates the onChange event again in the v-file-input. Since the input is cleared by the form reset, the data becomes undefined and when sent to the upload function it causes the error.
I added a check to see if the data file (referencefile) was undefined before executing the upload function.
if (this.referencefile !== undefined){
// execute the upload
}
- [Vuejs]-Laravel + Vuejs: How to link image to Laravel Public folder
- [Vuejs]-Vue child component not updating dynamically
Source:stackexchange.com