swal typy požáru
swal({
title: "Are you sure?",
text: "Your will not be able to recover this imaginary file!",
type: "danger",
showCancelButton: true,
confirmButtonClass: "btn-danger",
confirmButtonText: "Yes, delete it!",
closeOnConfirm: false
},
function(){
swal("Deleted!", "Your imaginary file has been deleted.", "success");
});
sweetalert2
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
sweet alert 2 proveďte akci na potvrzení
Swal.fire({
title: 'Do you want to save the changes?',
showDenyButton: true, showCancelButton: true,
confirmButtonText: `Save`,
denyButtonText: `Don't save`,
}).then((result) => {
/* Read more about isConfirmed, isDenied below */
if (result.isConfirmed) {
Swal.fire('Saved!', '', 'success')
} else if (result.isDenied) {
Swal.fire('Changes are not saved', '', 'info')
}
});
sladké upozornění 2
swal("Thank You!", "You clicked the button!", "success");
přepnout upozornění
swal({
title: "Good job!",
text: "You clicked the button!",
icon: "success",
button: "Aww yiss!"
});
sweetalert Úhlové 8
npm install --save sweetalert2