其他分享
首页 > 其他分享> > Q:layui开发中遇到的问题

Q:layui开发中遇到的问题

作者:互联网

1,当验证表单验证失败,出现红框在不失焦的情况下无法点击触发出日期弹框

trigger: 'click'

2,以下是table加分页整体代码示例

 

let table, layer,laydata, form;
layui.use(['form', 'laydate', 'table', 'layer'], function () {
form = layui.form;
laydate = layui.laydate;
table = layui.table;
layer = layui.layer;
layer.open({
type: 1,
title: '变动明细',
skin: 'hire-edit',
btn: ['确定'],
area: ["1000px", "500px"],
closeBtn: 1,
anim: 2,
shadeClose: true,
content: `<form class="layui-form integralSubsidiary">
<div class="layui-row layui-col-space10">
<div class="layui-col-md4">
<div class="layui-form-item">
<label class="layui-form-label">变动类型</label>
<div class="layui-input-block">
<select id="selectvalueArr" lay-verify="required"><option value=""></option></select>
</div>
</div>
</div>
<div class="layui-col-md5">
<div class="clearfix">
<div class="chose-date fl"><input lay-verify="required" type="text" class="layui-input" id="testDate1" placeholder="选择开始时间"></div>
<span class="chose-date-center fl tc">~</span>
<div class="chose-date fr"><input lay-verify="required" type="text" class="layui-input" id="testDate2" placeholder="选择结束时间"></div>
</div>
</div>
<div class="layui-col-md3">
<button type="button" lay-submit lay-filter="formDemo" class="layui-btn layui-btn-primary">查 询</button>
<button type="reset" class="layui-btn layui-btn-normal">重 置</button>
</div>
</div>
<div>
<table id="integralData"></table>
<div id="demo7" class="tr"></div>
</div>
</form>`,
success: function(layero, index) {
startAllAppoint = 0;//开始页数
limitAllAppoint = 10;//每页显示数据条数
currentPageAllAppoint = 1;//当前页数
laydate.render({
elem: '#testDate1',
type: 'datetime',
trigger: 'click'
});
getIntegralDetailType(arr => {
layui.form.render("select");
form.on('submit(formDemo)', function(data){
// layer.msg(JSON.stringify(data.field));

intergralDetail()
});
})

}
})
});

 

标签:function,layer,laydate,form,遇到,layui,开发,table
来源: https://www.cnblogs.com/chuanq/p/12453898.html