<!--静态文件-->
<picker mode="date" value="arrivedDate" bindchange="bindDateChange" start="{{arrivedDate}}" end="{{endDate}}" >
<view class="picker">
<view>{{arrivedDate}}</view>
<view class="pulldown">
<image mode="widthFix" src="../../images/mainicon/down.svg"></image>
</view>
</view>
</picker>
<!--js文件-->
date{
startDate: "",
arrivedDate: "",
endDate:""
}
onload:function(){
let y = new Date().getFullYear()
let m = new Date().getUTCMonth() + 1
let d = new Date().getUTCDate()
let ymd = y + "-" + m + "-" + d
let endYmd = y + "-" + (m + 2) + "-" + d
this.setData({ startDate: ymd, arrivedDate: ymd ,endDate:endYmd})
},
bindDateChange: function (e) {
let changeTime = e.detail.value
this.setData({ arrivedDate: changeTime })
},
问题解决了吗?是怎么解决了呀
你好,请把onload改成onLoad