layui的日期控件使用

导包请看官方:https://www.layui.com/doc/modules/laydate.html#use

例如:

<input type="text" id="yearCode" class="bs-input" style="width:130px;"  placeholder="年份">

js

layui.laydate.render({
    elem: '#yearCode' ,//input的id
   type: 'date'//年月日,也是默认,不要这个也可以 });

 

默认使用

type: 'year'

 

隐藏底部+点击就选择,两个必须一起,不然选择不了日期

showBottom: false,
change: function(value, date, endDate){
    $('#yearCode').val(value);
    $('.layui-laydate').remove();
}

 

官方:https://www.layui.com/doc/modules/laydate.html

 

全部评论

相关推荐

双尔:反手回一个很抱歉,经过慎重考虑,您与我的预期暂不匹配,感谢您的投递
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务