gpt4 book ai didi

javascript - 当 SweetAlert 在屏幕上时停止控件

转载 作者:行者123 更新时间:2023-11-29 10:07:37 25 4
gpt4 key购买 nike

<分区>

我正在使用 sweetalert2用于在我的代码中显示警报的库。

ConfirmationMessage = function(msg) {
swal({
title: "",
text: msg,
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Ok",
cancelButtonText: "Cancel",
closeOnConfirm: false,
closeOnCancel: false,
allowEscapeKey: true

});
}

这是 JS 函数,我在其他地方使用它。

if (!ConfirmationMessage("message to show.")) {
alert("if");
}
else {
alert("else");
}

我的问题是

I want to stop the control when the alert is on screen and want to decide on the button push if OK come to If Condition if Cancel come to else condition but control does not wait for the response in sweetalert2.

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com