代码
<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 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值就好了 git地址 吐槽一句官方两年了都没修复这个bug,也是佛了!
|