LayUI layer.open 按钮居中

,btnAlign: 'c'

举例:
dialogConfirm('分期还款确认', '/xx1/xx2','60%', '80%','确认','关闭','edit-submit',function (index, field) {}

function dialogConfirm(title, url, width, height,confirm, close,submitId, callback) { layer.open({ type: 2 , title: title , content: url , area: [width, height] ,btnAlign: 'c' , btn: ['<i class="layui-icon layui-icon-ok"></i>' + confirm, '<i class="layui-icon layui-icon-return">' + close] , yes: function (index, layero) { var iframeWindow = window['layui-layer-iframe' + index] , submitID = submitId , submit = layero.find('iframe').contents().find('#' + submitID); iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) { var field = data.field; callback(index, field); }); submit.trigger('click'); } }); };

  

posted @ 2021-01-27 00:11  ysloong  阅读(2507)  评论(0编辑  收藏  举报