最新版本中u-datetime-picker有一个坑就是返回的是时间戳,如果直接将绑定值格式化,页面上显示的还是时间戳
onBeginTimePicker(e) {
this.showBeginTimePicker = false;
this.params.beginTime = new Date(e.value).format("yyyy-MM-dd hh:mm:ss");
},
具体问题还未知,感觉是组件内部问题,解决方法为,加一个定时器,这样问题就解决了
onBeginTimePicker(e) {
this.showBeginTimePicker = false;
this.params.beginTime = new Date(e.value).format("yyyy-MM-dd hh:mm:ss");
setTimeout(() => {
this.params.beginTime = new Date(e.value).format("yyyy-MM-dd hh:mm:ss");
}, 100);
},