[Vuejs]-Error when trying to load image file – Vuejs

0👍

According to the error event.target is undefined and you are trying to call files[0] on undefined .

Make sure to pass the argument $event to onFileChanged() wherever you are calling this method like shown below:

<el-input type="file" @change="onFileChanged($event)"/>

Leave a comment