效果:
代码:
<view class="leave">
<view class="leaveLeft">生日:</view>
<view class="section">
<picker mode="date" :value="birthday" start="1970-01-01" @change="bindDateChange">
<view class="picker">{{birthday}}</view>
</picker>
</view>
</view>
data里定义的默认值:
birthday: '2021-01-01'
@change获取选择的日期:
bindDateChange (e) {
let that = this
that.birthday = e.detail.value
},