1.一定要关闭自动提交
<el-upload :action="'http://'+ serverIp +':8081/file/upload'" :auto-upload="false" ref="upload" :on-success="success" :on-error="error">
2.使用ref操作dom实现手动提交
<el-button @click="submit" style="margin-left:20px" type="success" size="small" icon="el-icon-share">文件上传</el-button>
方法:
submit(){
this.$refs.upload.submit();
},