Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.x的timepicker组件需要加上needConfirm属性 #7546

Open
1 task done
stevefoxuser opened this issue Apr 30, 2024 · 1 comment
Open
1 task done

3.x的timepicker组件需要加上needConfirm属性 #7546

stevefoxuser opened this issue Apr 30, 2024 · 1 comment

Comments

@stevefoxuser
Copy link

stevefoxuser commented Apr 30, 2024

  • 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
Copy link
Author

stevefoxuser commented Apr 30, 2024

给其他人看的如果你们也遇到了这个问题,我目前的解决方案是这样的
<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.')
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant