1.DatetimePicker 默认值无效问题 -- 解决办法:使用$refs解决
<u-datetime-picker
ref="defaultPicker"
:show="openDatePicker"
:value="dateValue"
mode="date"
minDate="-2209017943"
closeOnClickOverlay
confirmColor="#FF4E76"
@confirm="onConfirmPicker"
@cancel="onClosePicker"
@close="onClosePicker">
</u-datetime-picker>
export default {
data() {
return {
openDatePicker:false,
dateValue:Number(new Date()),//设置初始值
}
},
methods: {
onShowDatePicker(e) { // 需要回显的值e: '2021-06-08'
this.$refs.defaultPicker.innerValue = new Date(e).getTime();
this.openDatePicker = true;
},
},
}