elementui中上傳文件做校驗,文件上傳后檢驗語句消失


                        <el-form-item label="附件" label-width="100px"  prop="docsNew" ref="headimgUpload">
                          <div  class="file-con">
                            <div :key="key" v-for="(i, key) in item.docsNew" class="file-detail">
                              <div style="display: flex">
                                <el-tooltip effect="dark" :content="i.docName" placement="top-start">
                                  <span class="file-name" >{{i.docName}}</span>
                                </el-tooltip>
                                <!-- <span style="padding-right: 40px">{{i.date}}</span> -->
                                <!-- 刪除 -->
                                <span @click="handleRemove(item.docsNew, key)" ><i class="el-icon-delete"></i> </span>
                              </div>
                            </div>
                          </div>
                      <!-- 上傳 -->
                          <div @click="getPicture(index)" style="width: 100px">
                            <upload @handleAvatarSuccess="handleAvatarSuccessDocsNew" :baseUrl="baseUrl"></upload>
                          </div>
                        </el-form-item>

 

 
handleAvatarSuccessDocsNew(fileData){
    if(fileData.code == 200){
      Message.info(fileData.message)
      let file =  this.handleFileData(fileData)
      this.form.eventParts[this.index].docsNew.push(file)
      console.log("this.$refs.headimgUpload1", this.$refs.headimgUpload)
      this.$nextTick(() => {
        this.$refs.headimgUpload[this.index].clearValidate(); // 關閉校驗
      })
    }else {
      Message.info(fileData.message)
    }
  },
  getPicture(index){
       this.index = index;
   },

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM