Sweet alert 2 好的 去新页面 取消停留页面怎么办?
Sweet alert 2 Okay go to new page cancel stay at the page how?
你好,我的甜蜜提醒有一些问题,我在点击时重定向了用户,好吧,它会被发送到新页面,但如果取消,他们会留在同一页面并关闭提醒框,我该怎么做?
这是我的甜蜜警报代码
Swal.fire({
icon: 'success',
title: 'Insert Successfully!',
html: 'The information have inserted successfully!<br>By pressing <b>okay</b> this page will go to <b>manage user</b> page',
showCancelButton: true,
cancelButtonText: "Cancel",
confirmButtonText: 'Okay',
cancelButtonColor: '#d33',
confirmButtonColor: 'btn-success',
heightAuto: false,
})
// footer: '<label class="fixissue">How to fix this issue?</label><br>Try to change the username input and press add button again'
.then(Okay => {
window.location.href = 'manageUsers_api.html';
})
您好,我已经通过创建一个带有值 confirm
的 if 和 else if 来修复它
.then(function(inputvalue){
if(inputvalue.isConfirmed){
window.location.href = 'manageUsers_api.html';
} else if(inputvalue.isCancel){
Swal.fire('')
}
})
你好,我的甜蜜提醒有一些问题,我在点击时重定向了用户,好吧,它会被发送到新页面,但如果取消,他们会留在同一页面并关闭提醒框,我该怎么做?
这是我的甜蜜警报代码
Swal.fire({
icon: 'success',
title: 'Insert Successfully!',
html: 'The information have inserted successfully!<br>By pressing <b>okay</b> this page will go to <b>manage user</b> page',
showCancelButton: true,
cancelButtonText: "Cancel",
confirmButtonText: 'Okay',
cancelButtonColor: '#d33',
confirmButtonColor: 'btn-success',
heightAuto: false,
})
// footer: '<label class="fixissue">How to fix this issue?</label><br>Try to change the username input and press add button again'
.then(Okay => {
window.location.href = 'manageUsers_api.html';
})
您好,我已经通过创建一个带有值 confirm
的 if 和 else if 来修复它.then(function(inputvalue){
if(inputvalue.isConfirmed){
window.location.href = 'manageUsers_api.html';
} else if(inputvalue.isCancel){
Swal.fire('')
}
})