问题
I am trying to add an extra class for my modal so I can select it from LESS and turn it's background to transparent. But customClass is not working. Is there any other way to do it. BTW I have already changed a lot with default classes so I need to do this for just one modal, can not effect the global swal.
swal({
title: success,
showConfirmButton: false,
html: true,
customClass: ".swal-back"
});
回答1:
The customClass
option has been removed. You need to use className
now instead. The period before the class name is not necessary.
swal({
title: success,
showConfirmButton: false,
html: true,
className: "swal-back"
});
来源:https://stackoverflow.com/questions/48985966/adding-class-to-sweet-alert