当前位置:   article > 正文

a-upload自定义上传customRequest并接收多个参数_a-upload customrequest

a-upload customrequest
  1. <a-upload v-model:file-list="fileList" name="file" :showUploadList="false"
  2. :customRequest="e => customRequest(e, path)">
  3. <a-button type="primary" size="middle">
  4. <cloud-upload-outlined />上传
  5. </a-button>
  6. </a-upload>
  1. customRequest(options, path) {
  2. let formData = new FormData();
  3. formData.append("file", options.file);
  4. reqFileUpload(path, formData).then(response => {
  5. if (response.code == 0) {
  6. options.onSuccess(response, options.file);
  7. message.success('上传成功!');
  8. this.getFileList()
  9. } else {
  10. message.error(response.msg);
  11. }
  12. })
  13. }

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/339170
推荐阅读
相关标签
  

闽ICP备14008679号