AI智能
改变未来

element ui上传组件

 

 

[code] <el-form-item label=\"选择Excel\"><el-uploadref=\"upload\":auto-upload=\"false\":on-success=\"fileUploadSuccess\":on-error=\"fileUploadError\":disabled=\"importBtnDisabled\":limit=\"1\":action=\"BASE_API+\'eduservice/subject/addSubject\'\"name=\"file\"accept=\"application/vnd.ms-excel\"><el-button slot=\"trigger\" size=\"small\" type=\"primary\">选取文件</el-button><el-button:loading=\"loading\"style=\"margin-left: 10px;\"size=\"small\"type=\"success\"@click=\"submitUpload\">上传到服务器</el-button></el-upload></el-form-item>

其实就是一个表单 submit就行 核心方法

[code]//上传文件submitUpload(){this.importBtnDisabled = truethis.loading = truethis.$refs.upload.submit()},

 

赞(0) 打赏
未经允许不得转载:爱站程序员基地 » element ui上传组件