3.x的timepicker组件需要加上needConfirm属性
stevefoxuser opened this issue · 1 comments
stevefoxuser commented
- I have searched the issues of this repository and believe that this is not a duplicate.
What problem does this feature solve?
antd5.14版本都加上了,antdv不准备加吗?2.x的设计不挺好吗选了时间model就改了,非要点个确定干啥?
What does the proposed API look like?
3.x的timepicker组件需要加上needConfirm属性,像antd一样
stevefoxuser commented
给其他人看的如果你们也遇到了这个问题,我目前的解决方案是这样的
<a-time-picker format="HH:mm" v-model:value="pickedTime" @openchange="changeTimePoint" />
const changeTimePoint = function (isOpen:boolean) {
if(isOpen)return
const inputs = document.querySelectorAll(
'.ant-picker-time-panel-cell-selected .ant-picker-time-panel-cell-inner'
)
const h = inputs[0]?.innerHTML
const m = inputs[1]?.innerHTML
if (h && m) {
pickedTime.value = dayjs('2024-01-01 ' + h + ':' + m)
}else{
console.error('An error occurred when picking a time.')
}
}