添加一个 class 到 sweet alert 2
Adding a class to sweet alert 2
此问题已针对 sweetalert 1 提出
Adding class to sweet alert
现在我的问题是,如何在 sweetalert2 中添加自定义 class?
class名称:"new_class" 不适合我。
对于 sweetalert2
自定义 class 可以添加到多个目标:
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'
}
})
此问题已针对 sweetalert 1 提出 Adding class to sweet alert
现在我的问题是,如何在 sweetalert2 中添加自定义 class?
class名称:"new_class" 不适合我。
对于 sweetalert2
自定义 class 可以添加到多个目标:
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'
}
})