Compare commits

..

No commits in common. "baeed73205029dc9806012ed2fbf6f4f93fe3f38" and "91d65d4a64345762923191bb484f3034fd5b4ef9" have entirely different histories.

4 changed files with 7 additions and 19 deletions

View File

@ -16,14 +16,6 @@ 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`

View File

@ -16,14 +16,6 @@ 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`

View File

@ -1,6 +1,6 @@
{
"name": "vant",
"version": "2.12.29",
"version": "2.12.28",
"description": "Mobile UI Components built on Vue",
"main": "lib/index.js",
"module": "es/index.js",

View File

@ -1,11 +1,15 @@
import { raf } from '../utils/dom/raf';
import { raf, cancelRaf } 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);
@ -14,7 +18,7 @@ export function scrollLeftTo(
scroller.scrollLeft += (to - from) / frames;
if (++count < frames) {
raf(animate);
scrollLeftRafId = raf(animate);
}
}