LayUI表单时间控件laydate使用
为input标签设置id
<input type="text" class="layui-input" id="test1" placeholder="起始时间">
<span style="position: absolute;top: 2.5rem;left: 11.5rem;">-</span>
<input type="text" class="layui-input" id="test2" placeholder="结束时间" style="position: absolute;top: 1.8rem;left: 12.2rem;">
初始化laydate模块并渲染
layui.use('laydate', function(){
var laydate = layui.laydate;
//常规用法
laydate.render({
elem: '#test1'
});
laydate.render({
elem: '#test2'
});
});