Как я могу загрузить несколько файлов с помощью sweetalert2 - PullRequest
0 голосов
/ 05 мая 2020

Я хочу загрузить несколько файлов, этот код просто выбирает один файл для загрузки

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

Ссылка Codepen

1 Ответ

1 голос
/ 05 мая 2020

Вам нужно добавить multiple к вашему вводу

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