
1、自定义选择器组件需要用到picker-view跟picker-view-column。
2、打开选择器时就要获取到当前的年月日,使用for遍历直接生成年份数组跟月份数组。注:天数根据年份跟月份动态生成。
3、在选择的过程中,选择器有个改变事件,当年份或者月份改变的时候,天数要随之变化。
小程序官网关于picker的介绍
小程序官网提供了5中选择器,分别是:
普通选择器
多列选择器
时间选择器
日期选择器
省市区选择器
以下仅列举省市区选择器的用法:
index.wxml
index.js
多看文档,不然又要自己封装了。。。
属性选择器可以根据元素的属性及属性值来选择元素
1、E:hover;2、E:action;3、E:focus;4、E:enable;5、E:disabled;6、E:read-only;7、E:read-write;8、E:checked
(:first-child :last-child :nth-child() :nth-last-child() :nth-of-type() :nth-last-of-type() :first-of-type :last-of-type :only-child :only-of-type)
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)