JS 前端彈出確認訊息 確定以及取消 分別執行 Swal , confirmButton
Swal.fire({
title: title,
text: "是否確定覆蓋?",
icon: "success",
showCancelButton: true,
confirmButtonText: "確定",
cancelButtonText: "取消"
//確定後執行
}).then((result) => {
if (result.isConfirmed) {
Swal.fire({
title: title,
text: "成功",
icon: "success",
button: "確定"
});
}
}).catch(() => {
Swal.fire({
title: title,
text: "系統忙碌中",
icon: "error",
button: "確定"
});
});
參考:
https://blog.csdn.net/qq_42970173/article/details/109121226
留言
張貼留言