ele upload 文件格式返回了false files依然添加了数据进去?

onchange(file, fileList) {

  let roleList = ['image/jpeg','image/png','image/jpg','application/pdf']
  let isimgType = roleList.includes(file.raw.type)
   if(!isimgType) {
     this.$message.error('请上传JPG,PNG,JPEG,PDF格式文件')
     return false
   }
  fileList.forEach(item=>{
    if(item.raw){
       let url = URL.createObjectURL(item.raw)
    item.url = url
    }
   
  })
   this.files = fileList
},
待解决 悬赏分:40 - 离问题结束还有 170天15小时31分3秒
反对 0举报 0 收藏 0

我来回答

回答2