project init
This commit is contained in:
24
components/tabs/tabs.wxs
Normal file
24
components/tabs/tabs.wxs
Normal file
@@ -0,0 +1,24 @@
|
||||
/* eslint-disable */
|
||||
/* utils */
|
||||
|
||||
/**
|
||||
* animate */
|
||||
// 为tab切换添加动画
|
||||
function animate(options) {
|
||||
var result =
|
||||
'-webkit-transition-duration: ' +
|
||||
options.duration +
|
||||
's' +
|
||||
';transition-duration: ' +
|
||||
options.duration +
|
||||
's';
|
||||
result +=
|
||||
options.direction === 'Y'
|
||||
? ';transform: translate3d( 0,' + -100 * options.currentIndex + '%, 0)'
|
||||
: ';transform: translate3d( ' + -100 * options.currentIndex + '%,0, 0)';
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
animate: animate,
|
||||
};
|
||||
Reference in New Issue
Block a user