当另一个启动时,不要隐藏SweetAlert2



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

许多关于配置文档的演示/示例: https://sweetalert2.github.io/#configuration
将其添加为承诺,然后在当前 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>

最新更新