【问题标题】:How can i upload multiple files with sweetalert2如何使用 sweetalert2 上传多个文件
【发布时间】:2020-05-04 22:48:26
【问题描述】:

我要上传多个文件,这段代码只选择一个文件上传

const { value: file } = await Swal.fire({
  title: 'Select image',
  input: 'file',
  inputAttributes: {
    'accept': 'image/*',
    'aria-label': 'Upload your profile picture'
  }
})

Codepen link

【问题讨论】:

  • 您的 codepen 链接无效

标签: javascript jquery sweetalert sweetalert2


【解决方案1】:

您需要将multiple 添加到您的输入中

const { value: file } = await Swal.fire({
  title: 'Select image',
  input: 'file',
  inputAttributes: {
    'accept': 'image/*',
    'multiple': 'multiple', 
    'aria-label': 'Upload your profile picture'
  }
})

【讨论】:

  • 我们怎样才能同时显示所有图像?显示单个文件预览,但不显示多个。
猜你喜欢
  • 1970-01-01
  • 2016-08-10
  • 1970-01-01
  • 2019-10-01
  • 2020-11-07
  • 2015-04-20
  • 2020-04-09
  • 2021-09-03
  • 2015-10-23
相关资源
最近更新 更多