Element-ui 's upload uploads multiple files manually. Why do you request to upload multiple files separately? isn't it a batch? Please refer to the detailed code description in it.

<template>
  <div>
    <el-upload
          class="upload-demo"
          ref="upload"
          action="http://192.168.1.120:6001/gateway/app/content-aggr/content/addResource"
          :on-change="onchangeFunc"
          :multiple="bool"
          :headers="header"
          :data="datas"
          :on-preview="handlePreview"
          :on-remove="handleRemove"
          :file-list="fileList"
          :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>
          <div slot="tip" class="el-upload__tip">jpg/png500kb</div>
        </el-upload>
     </div>
</template>
export default {
  data(){
    return {
      bool:true,
      header:{
        "Authorization": "Bearer " + sessionStorage.getItem("session_Authorization"),
        "userId": sessionStorage.getItem("session_userId")
      },
      datas:{
        // files: files,
        ivFormat: "image/jpeg",
        ivHeight: "1000",
        ivName: "1111",
        ivSize: "11111",
        ivWidth: "2222",
      },
      fileList: []
    }
  },
  methods:{
    onchangeFunc(file, fileList){
      console.log("filelist");
      this.fileList=fileList;
    }
  }
}

clipboard.png

clipboard.png

Mar.22,2021

what you need is to upload several files at a time, right? Elemnet-ui has this function to upload several files at a time


, that is, asynchronous multiple requests for a single file


action= "http://192.168.1.120:6001/gateway/app/content-aggr/content/addResource":on-change="onchangeFunc". This function is to upload one


Thank you for your answer. Now that it is confirmed that the last single file was requested asynchronously multiple times, the question I would like to ask is, (: data= "datas") how to upload datas for a single file (or does it come with the same datas array for each request? Then the server handles it. Is it reasonable to,)

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35ce0-3438d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35ce0-3438d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?