laydate

layui.use('laydate', function() {
        var laydate = layui.laydate;
        
        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
                ,
            type: 'datetime',
            theme: 'yellow'
        });

        laydate.render({
            elem: '#end' //指定元素
        });    
    });

这里和layer不同的是要指定一个实例也就是一个dom元素

如果想自定义css属性 需要在csszhong 配置一个 theme(主题)

如下

<style type="text/css">
            /*可以自定义时间选择器颜色*/
            
            .laydate-theme-yellow {
                background-color: yellow;
                color: red;
                /*color: #007DDB;*/
            }
            /*该选中时间的背景色*/
            
            .laydate-theme-yellow .layui-this {
                background-color: red !important;
            }
        </style>

注意:找到对应的css名自行修改,如果不起作用就用!important关键字覆盖默认的颜色

posted @ 2019-04-01 10:02  LiuXiaoZhang  阅读(627)  评论(0编辑  收藏  举报