How to upload multiple Pictures and texts with elementUI

< form action= "/ addPackageType" method= "post" enctype= "multipart/form-data" >

                  <label for="packageName"></label>
                  <input type="text" name="packageName" id="packageName">
                  <label for="activeIcon"></label>
                  <input type="file"/ name="activeIcon">
                  <label for="defaultIcon"></label>
                  <input type="file"/name="defaultIcon">
                  <button type="submit"></buttom>
              </form>

previously, use the above code to upload multiple images and texts. [upload multiple pictures and questions at the same time]
backend [node] processed this request with formidable

without changing the backend,
now wants to use elementUI to achieve the above effect, how should I write it?

    <el-upload
            class="upload-demo"
            ref="upload"
            action="http://192.168.31.197:6688/pcfoodaddPackageType"
            :http-request="addPackageType"
            :data="package"
            :on-preview="handlePreview"
            :on-remove="handleRemove"
            :file-list="icons"
            :on-success="hha"
            multiple5 multiple5
            :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>
Mar.01,2021

through the implementation of http-request custom upload, you can get multiple local files through args.file, and then you can call your own interface

<template>
  <div>
    <el-upload action="null" multiple drag :http-request="myupload"></el-upload>
  </div>
</template>

<script>
export default {
  name: 'index',
  methods: {
    myupload(args) {
      console.info(args.file)
    }
  }
}
</script>
Menu