• 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=" 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;
       },

      

  • 相关阅读:
    反汇编测试20191325
    20191325mystat
    20191325学习笔记8
    20191325学习笔记7
    2.3.1测试 20191325
    20191214-改进ls
    团队作业4
    20191214-反汇编测试
    stat命令的实现-mysate(必做)
    图片
  • 原文地址:https://www.cnblogs.com/sinceForever/p/14373172.html
Copyright © 2020-2023  润新知