📜  如何将功能附加到按钮 sweetalert2 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:46.500000             🧑  作者: Mango

代码示例1


function successModal() {
    const Toast = Swal.mixin({
      toast: true,
      position: 'top-end',
      showConfirmButton: false,
      timer: 3000,
      timerProgressBar: true,
      didOpen: (toast) => {
        toast.addEventListener('mouseenter', Swal.stopTimer)
        toast.addEventListener('mouseleave', Swal.resumeTimer)
      }
    })

    Toast.fire({
      icon: 'success',
      title: 'Connected Successfully'
    })
}