0
点赞
收藏
分享

微信扫一扫

Element 携带文件 参数上传

Mhhao 2022-04-29 阅读 61
<div>
        <el-upload
          class="upload-demo"
          ref="upload"
          :headers="headers"
          :action="uploadUrl"
          :file-list="fileList"
          :on-change="beforeAvatarUpload"
          :on-success="iconSuccess"
          :on-error="iconErr"
          :data="dataList1"
          :auto-upload="false">
          <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
          <a style="height:33px; margin-left:15px;line-height:33px;"
            class="re-button-add"
            href="/template/AnnualEducationTraining.xlsx"
          >下载模板</a>
        </el-upload>
      </div>
      <div slot="footer">
        <el-button :size="$store.state.ELDEFAULTSIZE" @click="inloadCancel">取 消</el-button>
        <el-button :disabled="this.fileList.length == 0" :size="$store.state.ELDEFAULTSIZE" type="primary" @click="inloadSure()">确 定</el-button>
      </div>

dataList1对象设置需携带的参数

inloadSure() {
      this.fileData = new FormData()
      this.$refs.upload.submit()
     },

点击确定时新建Form Data 处罚 upload的submit

举报

相关推荐

0 条评论