将班级添加到甜蜜警报中 [英] Adding class to sweet alert

查看:104
本文介绍了将班级添加到甜蜜警报中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的模式添加一个额外的类,以便可以从LESS中选择它,并将其背景设置为透明.但是customClass无法正常工作.还有其他方法可以做到这一点.顺便说一句,我已经对默认类进行了很多更改,因此我只需要一个模态就可以做到这一点,不能影响全局swal.

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"
   });

推荐答案

customClass选项已被删除.您现在需要使用className来代替.班级名称前的句号不是必需的.

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"
});

这篇关于将班级添加到甜蜜警报中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆