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

van-tabs组件标签栏滚动缓慢 #13137

Open
tianqiqi00 opened this issue Sep 25, 2024 · 1 comment
Open

van-tabs组件标签栏滚动缓慢 #13137

tianqiqi00 opened this issue Sep 25, 2024 · 1 comment

Comments

@tianqiqi00
Copy link

重现链接

官网demo即可

Vant 版本

4.9.5

描述一下你遇到的问题。

我的iphone14pro上,开启省电模式的情况下,滚动动画执行缓慢
查完源码后发现省电模式会影响requestAnimationFrames,可以考虑优化

重现步骤

1.开启设备省电模式
2.在van-tabs组件中操作标签,使标签栏滚动

设备/浏览器

iphone14pro

@pany-ang
Copy link
Contributor

pany-ang commented Sep 26, 2024

导致这个现象的原因是组件内部默认按照每秒固定 60 帧来播放动画,所以当设备每秒帧率不足 60 比如只有 30 帧时,那么播放时长将翻一倍。

确实是可以优化的一个点,内部可以将「按照总帧率播放动画」更改为「按照总时间播放动画」

不过也是有代价的:在低帧率设备下,缺陷会从「滚动缓慢」变成「滚动卡顿感」

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

No branches or pull requests

2 participants