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

时间选择器 Time Picker 格式化(format="HH:mm:ss.SSS")后无法在编辑框内修改毫秒数 #5224

Closed
LuckyHookin opened this issue Sep 11, 2023 · 0 comments · Fixed by #5236
Labels
untriaged need to sort

Comments

@LuckyHookin
Copy link

TuSimple/naive-ui version (版本)

2.34.4

Vue version (Vue 版本)

3.3.4

Browser and its version (浏览器及其版本)

Microsoft Edge 版本 116.0.1938.76 (正式版本) (64 位)

System and its version (系统及其版本)

windows11

Node version (Node 版本)

Reappearance link (重现链接)

https://codesandbox.io/s/inspiring-kowalevski-rpzp2q?file=/src/Demo.vue

Reappearance steps (重现步骤)

在编辑框内修改毫秒数。

Expected results (期望的结果)

时间变量被修改

Actual results (实际的结果)

时间变量无法被修改

Remarks (补充说明)

首先看官方文档:https://www.naiveui.com/zh-CN/light/components/time-picker#format.vue
动画1
图示官方文档是允许在编辑框内修改值的。

但是当 format="HH:mm:ss.SSS" 时,意外发生了:
动画1
image
似乎 const {value: mergedValue} = mergedValueRef; 返回的时间戳是不含毫秒的

代码位置:https://github.com/tusen-ai/naive-ui/blob/cdca7e76c3fae6a723ab5abbd16afe31e226759b/src/time-picker/src/TimePicker.tsx#L658C7-L658C7

Demo:https://codesandbox.io/s/inspiring-kowalevski-rpzp2q?file=/src/Demo.vue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged need to sort
Projects
None yet
1 participant