参考elementui 文档

在这里插入图片描述

如何通过data 进行额外传递参数?(:data="uploadData")

<el-upload
	  ref="fileUploadBtn1"
	  class="upload-demo"
	  accept=".xls,.xlsx" 
	  :limit="1" 
	  :action="uploadFileUrl" 
	  :on-success="handleAvatarSuccess"
	  :before-upload="beforeAvatarUpload"
	  :data="uploadData"
	  :show-file-list="false">
	<el-button size="medium" type="primary">导入</el-button>
</el-upload>
data(){
	return{
      uploadData: {
        seId: "",
      }, 
   }
},
method(){
/* 文件上传之前将参数赋值 */
    beforeAvatarUpload(file) {
    	const _vm = this;
        _vm.uploadData.seId = this.form.id;
   }
}
Logo

基于 Vue 的企业级 UI 组件库和中后台系统解决方案,为数万开发者服务。

更多推荐