elementUI-upload upload file cannot connect to background interface
<el-upload
class="upload-demo"
ref="upload"
:action="uploadUrl"
:limit="1"
:on-exceed="handleExceed"
:on-remove="handleRemove"
:on-success="handleSuccess"
:file-list="fileList"
:auto-upload="false">
<el-button slot="trigger" size="small" type="primary" ></el-button>
</el-upload>
configure URL
uploadUrl: this.$http.adornUrl ("/ appartifact/addAppArtifactVersion") in data
upload files manually
dataFormSubmit () {
this.$refs.upload.submit();
}
Click to upload the network parameters
I don"t know why, solve
-split line-
replace it with the pre-upload hook: before-upload= "beforeUpload" to write, so you can use the background interface.
<el-upload
class="upload-demo"
ref="upload"
action=""
:before-upload="beforeUpload"
:limit="1"
:on-exceed="handleExceed"
:on-success="handleSuccess"
:auto-upload="false">
<el-button slot="trigger" size="small" type="primary" ></el-button>
</el-upload>