tabs.wxs 518 B

123456789101112131415161718192021222324
  1. /* eslint-disable */
  2. /* utils */
  3. /**
  4. * animate */
  5. // 为tab切换添加动画
  6. function animate(options) {
  7. var result =
  8. '-webkit-transition-duration: ' +
  9. options.duration +
  10. 's' +
  11. ';transition-duration: ' +
  12. options.duration +
  13. 's';
  14. result +=
  15. options.direction === 'Y'
  16. ? ';transform: translate3d( 0,' + -100 * options.currentIndex + '%, 0)'
  17. : ';transform: translate3d( ' + -100 * options.currentIndex + '%,0, 0)';
  18. return result;
  19. }
  20. module.exports = {
  21. animate: animate,
  22. };