0

我正在使用 SweetAlert2。我想在另一个警报后面显示一个警报,以便当用户单击“确定”按钮时,另一个警报会显示在它后面。

4

1 回答 1

0

配置文档上的许多演示/示例:https
: //sweetalert2.github.io/#configuration 将其添加为 Promise,然后在当前 SweetAlert 之后启动。

Swal.fire("1").then(x =>
  Swal.fire("2").then( x =>
    x.value && Swal.fire("3")))
    // check x.value, only fire "3" if button clicked
.then( x =>
  Swal.queue(["5","6","7"]))
  // you can also use queue to queue up alerts
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script>

于 2020-06-18T19:58:58.363 回答