Sweetalert2 allowOutsideClick 在 toast 模式下不起作用,关闭按钮未出现在右侧

Sweetalert2 allowOutsideClick not working on toast mode and close button not appearing on right side

我正在使用 https://sweetalert2.github.io/ 的 Sweetalert2,这是我的配置

  swal({
      title: 'Success!',
      type: 'success',
      toast: true,
      html: response.message,
      showCloseButton: true,
      showCancelButton: true,
      allowEscapeKey: true,
      allowOutsideClick: true,
      //focusConfirm: false,
      confirmButtonText: 'Continue Shopping',
      confirmButtonAriaLabel: 'Continue Shopping',
      cancelButtonText: '<a href="' + cartLink + '" style="color:white;">View Cart and Checkout</a>',
      cancelButtonColor: '#ff6d02',
      cancelButtonAriaLabel: 'Cart',
  });

这是结果

所以,问题是outsideclick true配置不起作用,关闭按钮不在右边。请问我该如何解决这个问题?

我是 SweetAlert2 的作者,感谢您提出这个问题。

1。关闭按钮

close button is not on the right

这已在最新版本 (v7.26.4) 中修复,请更新您的依赖项。

2。 allowOutsideClick 参数

allowOutsideClick 参数与 toast 不兼容,因为 toast 是 modeless 并且没有背景。在最新版本中,您将收到有关与 toasts 参数不兼容的控制台警告: