Element中Upload组件上传功能实现(图片和文件的默认上传及自定义上传)

  

  

  

  

  

  

  :action="uploadImgUrl"

  list-type="picture-card"

  :on-success="handleSuccess"

  :before-upload="handleBefore"

  :limit="limit"

  :on-error="handleError"

  :on-exceed="handleExceed"

  name="files"

  :on-remove="handleRemove"

  :show-file-list="true"

  :headers="headers"

  :file-list="fileList"

  :on-preview="handlePreview"

  :class="{ hide: this.fileList.length >= this.limit }"

  :disabled="disabled"

  :data="uploadData"

  >

  

  

  

  

  

  :close-on-click-modal="false"

  :close-on-press-escape="false"

  :visible.sync="isVisible"

  title="预览"

  width="800"

  append-to-body

  >