1.在製作小程序當中,當遇到要選擇日期的時候,我可能會選擇使用小程序提供的picker日期選擇器,從底部彈出進行選擇日期選擇。
<view style="width:30%">
<picker mode="date" value="{{beginTime}}" start="2008-08-08" end="2221-01-01" bindchange="bindStartDateChange" >
<input type="text" value="{{beginTime}}" class="search_content_input" style="margin-right: 2%;"/>
</picker>
</view>
<view>~</view>
<view style="width:30%">
<picker mode="date" value="{{endTime}}" start="2008-08-08" end="2221-01-01" bindchange="bindEndDateChange" >
<input type="text" value="{{endTime}}" class="search_content_input" style="margin-right: 2%;"/>
</picker>
</view>
- start 表示 日期選擇器能夠選擇的開始時間
- end 表示日期選擇器能夠選擇的結束時間
- value 表示日期選擇器的默認時間
- bindchange 表示點擊日期選擇器進行日期選擇事件的觸發