我如何使用 sweetalert2 上传多个文件

How can i upload multiple files with sweetalert2

我要上传多个文件,此代码只select上传一个文件

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

Codepen link

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

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