微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

微信小程序日历组件calendar详解及实例

微信小程序日历组件calendar详解及实例

模版使用:

rush:js;"> src="../cal/calendar.wxml"> is="calendar" data="{{selected_value,days,month,years,lunar_years,lunar_month,lunar_days,selectDateType,l unar_selected_value}}">

JS代码使用:

rush:js;"> var Calendar = require('../cal/calendar'); Page({ data: { selected_value: [],days: [],month: [],years: [],lunar_years: [],lunar_month: [],lunar_days: [],selectDateType: 1,lunar_selected_value: [] },.... // 指定选择器回调函数 new Calendar('key',this,function(date){ that.setData({ date: date }) });

样式

rush:js;"> .calendar{ position: absolute; bottom: 0; width: 100%; z-index: 999; background-color: #fff; } .tab{ display:inline-block; width:50%; text-align:center; font-size:16px; color: #ccc; } .tab-bar{ background-color: #eee; height: 40px; line-height: 40px; } .tab-bar .active{ color: #000; } .selected-item{ font-size: 28px; } .event-type_parent{ font-size: 14px; } .event-type_child{ text-align: center; line-height: 30px; } .event-type_txt{ display: inline-block; }

以上用法看不懂的话,具体就参考代码里面index目录下。

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。