这个问题已针对sweetalert 1提出 Adding class to sweet alert
现在我的问题是,如何在sweetalert2中添加自定义类?
className:“ new_class”对我不起作用。
答案 0 :(得分:2)
对于sweetalert2
,可以将自定义类添加到多个目标:
Swal.fire({
...
customClass: {
container: 'container-class',
popup: 'popup-class',
header: 'header-class',
title: 'title-class',
closeButton: 'close-button-class',
icon: 'icon-class',
image: 'image-class',
content: 'content-class',
input: 'input-class',
actions: 'actions-class',
confirmButton: 'confirm-button-class',
cancelButton: 'cancel-button-class',
footer: 'footer-class'
}
})