提交 2700d545 编写于 作者: 郭胜强

fix: 解决swiper组件previous-margin和next-margin属性设置后显示异常的问题

上级 cd800d34
......@@ -88,7 +88,7 @@ export default {
},
slidesStyle () {
var style = {}
if (this.nextMargin || this.nextMargin) {
if (this.nextMargin || this.previousMargin) {
style = this.vertical ? {
left: 0,
right: 0,
......@@ -101,10 +101,15 @@ export default {
right: this._upx2px(this.nextMargin)
}
}
style.width = this.vertical ? '100%' : Math.abs(100 / this.displayMultipleItemsNumber) + '%'
style.height = !this.vertical ? '100%' : Math.abs(100 / this.displayMultipleItemsNumber) + '%'
return style
},
slideFrameStyle () {
var value = Math.abs(100 / this.displayMultipleItemsNumber) + '%'
return {
width: this.vertical ? '100%' : value,
height: !this.vertical ? '100%' : value
}
},
circularEnabled () {
return this.circular && this.items.length > this.displayMultipleItemsNumber
}
......@@ -580,7 +585,8 @@ export default {
}, [
createElement('div', {
ref: 'slideFrame',
class: 'uni-swiper-slide-frame'
class: 'uni-swiper-slide-frame',
style: this.slideFrameStyle
}, swiperItems)
])]
if (this.indicatorDots) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册