//文本里面可以加html标签
let sure = layer.msg('<span style="font-size:20px">确定喜欢她吗?</span>', {
time: 0 //0表示不自动关闭 ,time自动关闭所需毫秒 ,单位是毫秒(1秒=1000毫秒)
, btn: ['<span style="font-size:20px">确定</span>', '<span style="font-size:20px">取消</span>'],
//success指的是 修改按钮的样式 三种样式left center right
success: function(layero){
layero.find('.layui-layer-btn').css('text-align', 'center')
}
, yes: function (index) {
点击确定触发事件
}
});
//sure指的是上面的msg弹出层,定义msg弹出层的样式
layer.style(sure,{
10px,
height:10px
});
转自:https://www.jianshu.com/p/de92f0f44bef