layui.layer宽度自适应
maxWidth当area属性为auto时有效
layer.open({ skin: 'layui-layer-admin', title:"弹层标题", type: 1, maxmin: true, area: ['auto','90%'], maxWidth:1200, shadeClose: true, content: html });
设置百分比宽度,打开弹层后重置最大宽度和位置,实现宽度自适应
layer.open({ skin: 'layui-layer-admin', title:'标题', type: 1, maxmin: true, area: ['90%','90%'], shadeClose: true, content: html, success:function(layero,index,that){ layer.style(index,{maxWidth:1200}); that.offset(); } });
layui自动触发select事件
来源:https://toscode.gitee.com/layui/layui/issues/I5JMRW
$(obj).siblings("div.layui-form-select").find("dl dd[lay-value='"+value+"']").click();
layui特殊方法
top.layui.index.openTabsPage(url,title);
关闭当前标签页:
window.top.layui.jquery('body').find('#LAY_app_tabs .layui-this .layui-tab-close').trigger('click');
Layui Admin中关闭当前标签页:
parent.layui.admin.events.closeThisTabs();
在layer.open打开的iframe中关闭自己:
parent.layer.close(parent.layer.getFrameIndex(window.name));
头部工具栏
table.render({ toolbar: '#demoBar', //开启头部工具栏 defaultToolbar: ['filter','print','exports'], //默认工具栏 });
layui插件
layui官方文档
https://layui.gitee.io/v2/
layui镜像网站
http://laizhefa.com/
https://www.layui.site/
treetable
https://gitee.com/ele-admin/treetable-lay
演示地址:https://whvse.gitee.io/treetable-lay/demo/
开发文档:https://gitee.com/whvse/treetable-lay/wikis/pages
layui mini后台管理模板
http://layuimini.99php.cn/
EasyAdmin后台管理系统 ThinkPHP6.0+layUI
http://easyadmin.99php.cn/
OPtable
http://hbangmao.gitee.io/layui-op-table/demo/index.html
soul table
https://saodiyang.gitee.io/layui-soul-table/
Dtree
https://www.wisdomelon.com/DTreeHelper/
xmSelect
https://maplemei.gitee.io/xm-select/
TableSelect
https://gitee.com/lolicode/layui_component_tableselect