How vue uploads multiple files at a time instead of uploading them one by one

< el-upload

                  class="upload-demo"
                  ref="upload"
                  action="http://add"
                  name="Content"
                  :data="form"
                  :on-remove="handleRemove"
                  :on-error="uploadError"
                  :on-success="uploadSuccess"
                  :multiple="multiple"
                  :file-list="fileList"
                  :on-change="addFile"
                  :auto-upload="false">
              <el-button slot="trigger" size="small" type="primary"></el-button>
              <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload"></el-button>
          </el-upload>

you can convert files to array format in the addFile method, and then transfer these images to FormData, and finally upload them to FormData

let images=[...files]
let _data = new FormData();
images.forEach((img,index) => {
    _data.append(`img_${index}`,img)
})

so: do I need to fill in file-list= "fileList"?

Menu