sweetAlert2 确认点击后如何调用引导模式?
我想在单击SweetAlert2的确认按钮后打开一个模态。但点击后什么也没有发生。
我发现这个是唯一的,这和我现在遇到的问题是一样的。
我也尝试过同样的方法,但不起作用,也许是因为他有最旧版本的 SweetAlert。
不管怎样,这是我的代码:
Swal.fire({
title: 'Process Selected Item(s)?',
icon: 'warning',
allowOutsideClick: false,
allowEscapeKey: false,
allowEnterKey: false,
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'YES!',
cancelButtonText: 'No, cancel!',
reverseButtons: true,
allowOutsideClick: false
}).then((result) => {
if (result.isConfirmed) {
$('#processItemsModal').modal('show');
} else{
Swal.fire(
'Cancelled',
'No changes has been made!',
'error'
)
}
})
你认为我在这里缺少什么?
TIA
I want to open a modal after clicking the confirm button of SweetAlert2. But nothing happens after clicking it.
I found this one and only, which is the same issue I'm having now.
I've tried the same, but it doesn't work, maybe because he had the oldest version of SweetAlert.
Anyway, here's my code:
Swal.fire({
title: 'Process Selected Item(s)?',
icon: 'warning',
allowOutsideClick: false,
allowEscapeKey: false,
allowEnterKey: false,
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'YES!',
cancelButtonText: 'No, cancel!',
reverseButtons: true,
allowOutsideClick: false
}).then((result) => {
if (result.isConfirmed) {
$('#processItemsModal').modal('show');
} else{
Swal.fire(
'Cancelled',
'No changes has been made!',
'error'
)
}
})
What do you think I am missing here?
TIA
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决了我的问题,因为我使用的是 Bootstrap v5。
而不是这个;
我用过这个;
Solved my issue since I am using Bootstrap v5.
Instead of this;
I used this;