案例:
html:
html
<view class="huanhang">
<view class="fontBold">发起时间:</view>
<view class="fontBold"> <picker class="getBusTime" mode="date" data-namesa="staDate" model:value="{{staDate?staDate:''}}" start="2020-01-01" end="2040-01-01" bindchange="bindFormDateChange">
<view style="color: #000;" class="getBusTimeRight fontSize34">{{staDate}}</view>
</picker></view>
</view>
js:
javascript
data:{
staDate:"选择时间",
},
bindFormDateChange: function (e) {
this.setData({
[e.target.dataset.namesa]: e.detail.value
})
},