0

我想更改按钮的变量名称。怎么做?

Swal.fire({
    title: 'Select one?',
    showDenyButton: true,
    showCancelButton: true,
    confirmButtonText: 'Banana',
    denyButtonText: `Apple`,
  }).then((result) => {
    if (result.isBanana) { // < --I want to get isBanana instead of isConfirmed
      Swal.fire('Banana Selected!', '', 'info') 
    } else if (result.isApple) {
      Swal.fire('Apple Selected!', '', 'info')
    }
  })

我使用的是 sweetalert2 "Swal.fire()" 而不是 "Swal()"

4

0 回答 0