We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
2.28.2
3.2.33
所有主流浏览器
Windows
https://github.com/TuSimple/naive-ui/blob/main/src/countdown/src/Countdown.tsx#L58
使用 Downcount 组件,设置倒计时 五秒钟,precision 设为默认值(0)。
在源码 frame 方法中打印 const distance = getDistance(performance.now()) 代码声明的 distance 变量,会发现精度错误。
const distance = getDistance(performance.now())
并监听 finish 事件,在 0 秒时此事件不会触发,再过一秒后触发。
在 0 秒时触发 finish 事件。
实际在 0 秒后再过一秒才会触发时间
解决精度问题
The text was updated successfully, but these errors were encountered:
4d88362
这个主要原因是 4.0 ~ 4.9 秒现实中应该被显示为 5 秒,但是之前实现成了 4 秒
Sorry, something went wrong.
所以 duration 实际是没问题的,问题是出在了显示
No branches or pull requests
TuSimple/naive-ui version (版本)
2.28.2
Vue version (Vue 版本)
3.2.33
Browser and its version (浏览器及其版本)
所有主流浏览器
System and its version (系统及其版本)
Windows
Node version (Node 版本)
Reappearance link (重现链接)
https://github.com/TuSimple/naive-ui/blob/main/src/countdown/src/Countdown.tsx#L58
Reappearance steps (重现步骤)
使用 Downcount 组件,设置倒计时 五秒钟,precision 设为默认值(0)。
在源码 frame 方法中打印
const distance = getDistance(performance.now())
代码声明的 distance 变量,会发现精度错误。并监听 finish 事件,在 0 秒时此事件不会触发,再过一秒后触发。
Expected results (期望的结果)
在 0 秒时触发 finish 事件。
Actual results (实际的结果)
实际在 0 秒后再过一秒才会触发时间
Remarks (补充说明)
解决精度问题
The text was updated successfully, but these errors were encountered: