[Vuejs]-How validate two file input with vue.js

1👍

methods:{
      onFileChangePic(event){
        let isGoodToGo = true
        let files = event.target.files
        for (let i=0; i<files.length; i++) {
            let file = files[i]
          if(file.type != 'application/pdf'){
            isGoodToGo = false
         }
        }
        this.vvv = isGoodToGo
      }
  }

Fiddle link: https://jsfiddle.net/shivampesitbng/k3h1x0jq/11/

Loop through all the files to check its type for validation.

Leave a comment