VueJs File process

v-model can't be used in a file input. Because, v-model would try to set the “value” of the input, which is not possible for file inputs. Also, you would have to process the FileList Object anyway.

HTML
<input type="file", @change="processFile($event)">
JavaScript:
methods: {
  processFile(event) {
    this.someData = event.target.files[0]
  }
}

Labels: ,

© copyright-2020 Rejaul