This commit is contained in:
mo.duan 2019-09-19 15:49:20 +08:00
parent e8f22ea094
commit 68ff748436
3 changed files with 73 additions and 31 deletions

View file

@ -113,10 +113,13 @@
];
},
trackStyles () {
// #6076
const visibleStyle = this.trackIndex === -1 ? 'hidden' : 'visible';
return {
width: `${this.trackWidth}px`,
transform: `translate3d(${-this.trackOffset}px, 0px, 0px)`,
transition: `transform 500ms ${this.easing}`
transition: `transform 500ms ${this.easing}`,
visibility : visibleStyle
};
},
copyTrackStyles () {
@ -125,7 +128,7 @@
transform: `translate3d(${-this.trackCopyOffset}px, 0px, 0px)`,
transition: `transform 500ms ${this.easing}`,
position: 'absolute',
top: 0
//top: 0
};
},
arrowClasses () {
@ -198,8 +201,8 @@
child.width = this.listWidth;
child.height = typeof this.height === 'number' ? `${this.height}px` : this.height;
});
this.trackWidth = (this.slides.length || 0) * this.listWidth;
const slidesLength = this.slides.length || 0
this.trackWidth = slidesLength * this.listWidth;
},
// use when slot changed
slotChange () {

View file

@ -24,15 +24,14 @@
&-track {
position: relative;
top: 0;
top: 100%;
left: 0;
display: block;
overflow: hidden;
z-index: 1;
&.higher {
z-index: 2;
top: 0;
}
}