undefinedfix
Sign in

How does the El upload component terminate the request being uploaded?

chas35 edited in Thu, 26 Jan 2023

How does the El upload component terminate the request being uploaded? abort

How to cancel the upload request?

2 Replies
loginfun88idc
commented on Thu, 26 Jan 2023

The upload component of element has the abort method. You can declare a ref attribute to El upload, such as

<el-upload ref="uploader" :auto-upload="false">
  <el-button type="primary">upload</el-button>
</el-upload>

Then when you want to cancel the request, use this$ refs.uploader.abort ()。

yitnc
commented on Fri, 27 Jan 2023

Can this method automatically clear the file? Do you want to do it yourself