mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[improvement] Tab: use transform to improve animation performance
This commit is contained in:
parent
1158a31cb1
commit
2bf84cd790
@ -134,6 +134,7 @@
|
||||
|
||||
### Tab
|
||||
|
||||
- 优化`animated`动画性能
|
||||
- 修复开启`animated`后高度错误的问题
|
||||
|
||||
### Tabbar
|
||||
|
@ -206,7 +206,7 @@ exports[`renders demo correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<div class="van-tabs__content">
|
||||
<div class="van-tabs__track" style="left: 0%; transition-duration: 0.3s;">
|
||||
<div class="van-tabs__track" style="transform: translate3d(0%, 0, 0); transition-duration: 0.3s;">
|
||||
<div class="van-tab__pane-wrapper">
|
||||
<div class="van-tab__pane">
|
||||
内容 1
|
||||
|
@ -111,7 +111,7 @@ export default sfc({
|
||||
trackStyle() {
|
||||
if (this.animated) {
|
||||
return {
|
||||
left: `${-1 * this.curActive * 100}%`,
|
||||
transform: `translate3d(${-1 * this.curActive * 100}%, 0, 0)`,
|
||||
transitionDuration: `${this.duration}s`
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user