DWQA QuestionsCategory: ProgramCompatibility of iView upload component
zhang asked 1 month ago

When uploading files, the hook on progress is not compatible with the browser edge of win10. How to solve this problem
<Col span=”9″ offset=”2″>

          <Upload
            :before-upload="handleUpload3"
            action="//upload-z2.qiniup.com"
            :data="imgData3"
            :on-success="handleOnSuccess3"
            :on-progress="handleOnProgress3"
            :format="['stl']"
            :on-format-error="handleFormatError">
            <Button type="ghost" class="Choose" :disabled="isUpload3" v-if="!isUpload3 && !file3">{{dataUpLoad.uploadBtn}}</Button>
            <div onclick="window.onbeforeunload=null">
              <a href="javascript:;" v-if="file3" class="download" :title="dataUpLoad.reminderContent">{{isUpload3 ? '' : fileName3}}</a>
            </div>
          </Upload>
          <!--<div onclick="window.onbeforeunload=null">
            <a :href="[file3]" v-if="file3" class="download" :title="dataUpLoad.reminderContent">{{fileName3}}</a>
          </div>-->
        </Col>

handleOnProgress3(event,file,fileList){

console.log(event)
  console.log(file.percentage)
  console.log(fileList)
  //this.isUpload3 = true
  if(file.percentage<100){
    window.onbeforeunload = function(event){
      Return 'the file is being uploaded. Are you sure you want to leave this page? '
    }
  }
},
xiaowenzi replied 1 month ago

Has it been solved? My method of handleonprogress3 on Chrome browser is not implemented either

1 Answers
Ah Qi answered 1 month ago

Have you solved it? I’ve had this problem, too,

:on-progress

Bound methods do not trigger