【问题标题】:SweetAlert open another alert with prevent closing previous alertSweetAlert 打开另一个警报,防止关闭以前的警报
【发布时间】:2021-10-17 13:31:25
【问题描述】:

我想与前一个警报一起打开另一个警报并防止关闭前一个警报,但前一个警报关闭并新打开。 我使用了iziToast,我可以这样做,但我想使用 SweetAlert。

SweetAlert 示例:

const swalToast = Swal.mixin({
  toast: true,
  iconColor: "white",
  customClass: { popup: "colored-toast" },
  showConfirmButton: false,
  timerProgressBar: true,
});

swalToast.fire({
  title: "One",
  position: "bottom",
  timer: 5000,
  icon: "info",
});

setTimeout(() => {
  swalToast.fire({
    title: "Two",
    position: "bottom",
    timer: 1500,
    icon: "info",
  });
}, 2000);

iziToast 示例:

iziToast.info({
  position: "bottomCenter",
  title: "One",
  message: "",
  timeout: 5000,
});

setTimeout(() => {
  iziToast.info({
    position: "bottomCenter",
    title: "Two",
    message: "",
    timeout: 1500,
  });
}, 2000);

【问题讨论】:

  • 也许如果你在模态框中做第一个警报,第二个是警报

标签: javascript toast sweetalert sweetalert2


【解决方案1】:
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-09-22
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多