如何改变sweetalert按钮文字?

时间:2018-02-28 10:16:49

标签: jquery sweetalert

我想用“选择患者”更改“确定”按钮,将“取消”改为“速度情况”。我怎么能这样做?

swal({
  text: "Start new case by",
  buttons: true,
  confirmButtonText: "Select Patient?",
  cancelButtonText: "Speed Case?",      
});

4 个答案:

答案 0 :(得分:8)

swal({
  text: "Start new case by",
  buttons: ["Select Patient?", "Speed Case?"],
});

答案 1 :(得分:4)

这是答案

 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
        },

希望它适合你

答案 2 :(得分:1)

您可以使用此方法

swal({
  text: "Start new case by",
  showCancelButton: true,
  confirmButtonText: "Select Patient?",
  cancelButtonText: "Speed Case?",     
  title: 'Title'
});

答案 3 :(得分:0)

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']
});