小程序解决安卓端van-datetime-picker选择时间时,自己滚动问题

代码

<van-popup show="{{ showtime }}" round position="bottom" custom-style="height: 346px" bind:close="onCloseTime" close-icon="cross" closeable>
	<view class="pbox2 mt-100">
		<van-datetime-picker type="year-month" min-date="{{ minDate }}" max-date="{{ maxDate }}"
	        bind:change="onInputTime" show-toolbar="{{false}}" formatter="{{ formatter }}"/>
	view>
	<view class="btn2" bindtap="onTime">确定view>
van-popup>
// 获取时间
onInputTime(event) {
  // let time = getTime(event.detail, 4)
  // let gettime = getTime(event.detail, 5)
  let gettime = event.detail.getColumnValue(0).split('年')[0]+event.detail.getColumnValue(1).split('月')[0]
  let time = event.detail.getColumnValue(0)+event.detail.getColumnValue(1)
  this.setData({
    currentDate: event.detail.getColumnValue(0)+':'+event.detail.getColumnValue(1),
    gettime: gettime,
    nowtime1: time
  });
},

其实就是把bind:input改成bind:change然后不去绑定value值就好了
小程序解决安卓端van-datetime-picker选择时间时,自己滚动问题_第1张图片
git地址
吐槽一句官方两年了都没修复这个bug,也是佛了!

你可能感兴趣的:(小程序,小程序)