web-dev-qa-db-ja.com

sweetalertボタンのテキストを変更するには?

「Ok」ボタンを「Select patient」および「Cancel」から「Speed case」に変更したい。どうやってやるの?

swal({
  text: "Start new case by",
  buttons: true,
  confirmButtonText: "Select Patient?",
  cancelButtonText: "Speed Case?",      
});
6
Dip Girase
swal({
  text: "Start new case by",
  buttons: ["Select Patient?", "Speed Case?"],
});
8
RohitIUC

ここに答えがあります

 swal({
            title: "Are you sure?",
            text: "you want to Cancel Operation!",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: '#DD6B55',
            confirmButtonText: 'Yes, I am sure!',
            cancelButtonText: "No, cancel it!",
            closeOnConfirm: false,
            closeOnCancel: false
        },

それがあなたのために働くことを願っています

12
user8718405
swal({
    title: 'Are you sure?',
    text: 'Once deleted, you will not be able to recover this imaginary file!',
    icon: 'warning',
    buttons: true,
    dangerMode: true,
    buttons: ['yes, forsure', 'no, thanks']
});
0
Yamen Ashraf