即使在 promise 被解决并触发 @fail 事件之后,QUploader 也会失败(如果 updateProgress 设置为 1,进度条是红色的,并且停留在 99% 处)。
<q-uploader
:url="url"
:upload-factory="uploadFile"
:send-raw="true"
:headers="{ 'content-type': 'application/x-www-form-urlencoded' }"
:no-content-type="true"
@add="uploadFileAdded"
@start="uploadStarted"
@finish="uploadFinished"
@uploaded="uploadedFile"
@fail="uploadFailed"
color="orange"
text-color="black"
auto-expand
extensions=".csv"
inverted-light
float-label="Upload List"
:multiple="false"
:hide-upload-button="false"
:hide-upload-progress="false"
:clearable="true"
/>
uploadFile(file, updateProgress) {
return new Promise((resolve, reject) => {
resolve("Hi");
});
},