mirror of
https://gitee.com/vant-contrib/vant.git
synced 2026-07-13 09:21:05 +08:00
Compare commits
3 Commits
91d65d4a64
...
baeed73205
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
baeed73205 | ||
|
|
dedfff665d | ||
|
|
cc2a40450e |
@ -16,6 +16,14 @@ Vant follows [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/).
|
||||
|
||||
## Details
|
||||
|
||||
### [v2.12.29](https://github.com/youzan/vant/compare/v2.12.28...v2.12.29)
|
||||
|
||||
`2021-09-22`
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- Tabs: failed to scroll into view when render multiple tabs [#9542](https://github.com/youzan/vant/issues/9542)
|
||||
|
||||
### [v2.12.28](https://github.com/youzan/vant/compare/v2.12.27...v2.12.28)
|
||||
|
||||
`2021-09-20`
|
||||
|
||||
@ -16,6 +16,14 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。
|
||||
|
||||
## 更新内容
|
||||
|
||||
### [v2.12.29](https://github.com/youzan/vant/compare/v2.12.28...v2.12.29)
|
||||
|
||||
`2021-09-22`
|
||||
|
||||
**Bug Fixes**
|
||||
|
||||
- Tabs: 修复多个 Tabs 组件同时存在时动画失效的问题 [#9542](https://github.com/youzan/vant/issues/9542)
|
||||
|
||||
### [v2.12.28](https://github.com/youzan/vant/compare/v2.12.27...v2.12.28)
|
||||
|
||||
`2021-09-20`
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vant",
|
||||
"version": "2.12.28",
|
||||
"version": "2.12.29",
|
||||
"description": "Mobile UI Components built on Vue",
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
|
||||
@ -1,15 +1,11 @@
|
||||
import { raf, cancelRaf } from '../utils/dom/raf';
|
||||
import { raf } from '../utils/dom/raf';
|
||||
import { getScrollTop, setScrollTop } from '../utils/dom/scroll';
|
||||
|
||||
let scrollLeftRafId: number;
|
||||
|
||||
export function scrollLeftTo(
|
||||
scroller: HTMLElement,
|
||||
to: number,
|
||||
duration: number
|
||||
) {
|
||||
cancelRaf(scrollLeftRafId);
|
||||
|
||||
let count = 0;
|
||||
const from = scroller.scrollLeft;
|
||||
const frames = duration === 0 ? 1 : Math.round((duration * 1000) / 16);
|
||||
@ -18,7 +14,7 @@ export function scrollLeftTo(
|
||||
scroller.scrollLeft += (to - from) / frames;
|
||||
|
||||
if (++count < frames) {
|
||||
scrollLeftRafId = raf(animate);
|
||||
raf(animate);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user