<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