fix(tab): refactor animation without transform (#3668)

fix #3659
This commit is contained in:
rex 2020-10-13 20:09:59 +08:00 committed by GitHub
parent bdf6660fcd
commit 3d6a460bd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -95,7 +95,7 @@
&--animated {
display: flex;
transition-property: transform;
transition-property: left;
}
}

View File

@ -68,10 +68,14 @@ function trackStyle(data) {
}
return [
'transform: translate3d(' + -100 * data.currentIndex + '%, 0, 0)',
'-webkit-transition-duration: ' + data.duration + 's',
'transition-duration: ' + data.duration + 's',
].join(';');
['left', -100 * data.currentIndex + '%'],
['-webkit-transition-duration', data.duration + 's'],
['transition-duration: ', data.duration + 's'],
]
.map(function (item) {
return item.join(':');
})
.join(';');
}
function lineStyle(data) {