增加skin参数,自定义皮肤样式。
layer.confirm(content,{btn:btn,skin:hbk-class,area: [500px, 300px],btn1:function(index){console.log("点击了我知道了");var id = res.data[0].id;console.log("id="+id);// 更新消息状态$.ajax({url:ctx+"sys/msg/readMsg/"+id,type:post,dataType:json,success:function(res){console.log("更新状态成功");console.log(res);layer.close(index);},error:function(err){console.log("更新状态失败");console.log(err);}});},btn2:function(){console.log("点击了取消");},title:title});
<style>.hbk-class .layui-layer-title{background:red; color:#fff; border: none;}.hbk-class .layui-layer-btn .layui-layer-btn0{background:#E12D2E;color:#FFF}.hbk-class .layui-lay