close
如下粗體的部分
Just add your custom function to catch the rejection, for example:
swal({
title: 'Some title',
text: 'some text for the popup',
type: 'warning',
showCancelButton: true,
cancelButtonText: 'Some text for cancel button'
}).then(function(){
// function when confirm button clicked
}, function(dismiss){
if(dismiss == 'cancel'){
// function when cancel button is clicked
}
});
You can even add more function to catch another dismiss event, just read SweetAlert2 Docs for more info about dismiss event.
--
https://stackoverflow.com/questions/42378426/sweetalert2-bind-another-event-to-cancel-button
全站熱搜
留言列表