Compare commits

...

3 Commits

Author SHA1 Message Date
chenjiahan
baeed73205 docs(changelog): 2.12.29 2021-09-22 16:07:07 +08:00
chenjiahan
dedfff665d chore: release 2.12.29 2021-09-22 16:03:54 +08:00
neverland
cc2a40450e
fix(Tabs): failed to scroll into view when render multiple tabs (#9542) 2021-09-22 16:01:51 +08:00
4 changed files with 19 additions and 7 deletions

View File

@ -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`

View File

@ -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`

View File

@ -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",

View File

@ -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);
}
}