上国外网站dns,eclipse与jsp网站开发,营销型网站建站公司,公众号注册微信小程序的picker是一个功能强大的组件#xff0c;它可以是一个普通选择器#xff0c;也可以是多项选择器#xff0c;也可以是时间、日期、省市区选择器。
官方文档在这里
这里讲一下date picker的用法。
view classsectionview classse…微信小程序的picker是一个功能强大的组件它可以是一个普通选择器也可以是多项选择器也可以是时间、日期、省市区选择器。
官方文档在这里
这里讲一下date picker的用法。
view classsectionview classsection__title日期选择器/viewpicker modedate value{{date}} start2015-09-01 end2017-09-01 bindchangebindDateChangeview classpicker当前选择: {{date}}/view/picker
/viewbindDateChange: function(e) {console.log(picker发送选择改变携带值为, e.detail.value)this.setData({date: e.detail.value})}这里的mode选择为“date”这个时间格式一般是“2025-01-24”这样的格式。 实际从bindDateChange中拿到的“e.detail.value”的值包含了年月日但是具体的格式跟手机系统设置的格式相关。 start和end指定了时间限定的日期。 这里还有一个参数fields可以选择year, month和day。
如果选择day, 那么选择框里面可以选择年、月和日了而且从bindDateChange中拿到的“e.detail.value”的值包含了年月日跟默认是一样的。
如果选择year, 那么选择框里面只能选择年份了而且从bindDateChange中拿到的“e.detail.value”的值只包含了年没有其他信息了。
view classcontainerpicker modedate fieldsyear value{{date}} bindchangebindDateChange{{date}}/picker
/view如果选择month, 那么选择框里面可以选择年和月份了适合于你只需要显示年份和月份的格式而且从bindDateChange中拿到的“e.detail.value”的值包含了年和月。
view classcontainerpicker modedate fieldsmonth value{{date}} bindchangebindDateChange{{date}}/picker
/view