欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

微信小程序使用picker實(shí)現(xiàn)時(shí)間和日期選擇框功能【附源碼下載】

 更新時(shí)間:2017年12月11日 08:57:49   作者:FutrueJet  
這篇文章主要介紹了微信小程序使用picker實(shí)現(xiàn)時(shí)間和日期選擇框功能,結(jié)合實(shí)例形式分析了微信小程序picker組件進(jìn)行日期與時(shí)間選擇的相關(guān)操作技巧,并附帶源碼供讀者下載參考,需要的朋友可以參考下

本文實(shí)例講述了微信小程序使用picker實(shí)現(xiàn)時(shí)間和日期選擇框功能。分享給大家供大家參考,具體如下:

1、效果展示

2、關(guān)鍵代碼

① index.wxml

<picker value="{{picker1Value}}" range="{{picker1Range}}" bindchange="normalPickerBindchange">
  當(dāng)前城市選擇:{{picker1Range[picker1Value]}}
</picker>
<picker mode="time" value="{{timeValue}}" start="00:00" end="24:00" bindchange="timePickerBindchange">
 當(dāng)前時(shí)間選擇: {{timeValue}}
</picker>
<picker mode="date" value="{{dateValue}}" start="1999-01-01" end="2999-12-12" bindchange="datePickerBindchange">
 當(dāng)前日期選擇: {{dateValue}}
</picker>

② index.js

Page({
 data:{
  // text:"這是一個(gè)頁面"
  picker1Value:0,
  picker1Range:['北京','上海','廣州','深圳'],
  timeValue:'08:08',
  dateValue:'2016-10-13'
 },
 normalPickerBindchange:function(e){
  this.setData({
   picker1Value:e.detail.value
  })
 },
 timePickerBindchange:function(e){
  this.setData({
   timeValue:e.detail.value
  })
 },
 datePickerBindchange:function(e){
  this.setData({
   dateValue:e.detail.value
  })
 }
})

3、源代碼點(diǎn)擊此處本站下載。

關(guān)于picker組件的詳細(xì)介紹可參考官網(wǎng):https://mp.weixin.qq.com/debug/wxadoc/dev/component/picker.html

希望本文所述對大家微信小程序開發(fā)有所幫助。

相關(guān)文章

最新評論