提交 e9c8c4ed 编写于 作者: X xzs02

fix: 解决swiper组件报错的问题

上级 c7c506eb
...@@ -558,24 +558,25 @@ export default { ...@@ -558,24 +558,25 @@ export default {
}, },
render (createElement) { render (createElement) {
var slidesDots = [] var slidesDots = []
var index = 0
var swiperItems = [] var swiperItems = []
if (this.$slots.default) { if (this.$slots.default) {
this.$slots.default.forEach(vnode => { this.$slots.default.forEach(vnode => {
if (vnode.componentOptions && vnode.componentOptions.tag === 'v-uni-swiper-item') { if (vnode.componentOptions && vnode.componentOptions.tag === 'v-uni-swiper-item') {
swiperItems.push(vnode) swiperItems.push(vnode)
}
})
}
for (let index = 0, length = swiperItems.length; index < length; index++) {
let currentSync = this.currentSync
slidesDots.push(createElement('div', { slidesDots.push(createElement('div', {
class: { class: {
'uni-swiper-dot': true, 'uni-swiper-dot': true,
'uni-swiper-dot-active': (index < this.currentSync + this.displayMultipleItemsNumber && index >= this.currentSync) || (index < this.currentSync + this.displayMultipleItemsNumber - this.items.length) 'uni-swiper-dot-active': (index < currentSync + this.displayMultipleItemsNumber && index >= currentSync) || (index < currentSync + this.displayMultipleItemsNumber - length)
}, },
style: { style: {
'background': index === this.currentSync ? this.indicatorActiveColor : this.indicatorColor 'background': index === currentSync ? this.indicatorActiveColor : this.indicatorColor
} }
})) }))
index++
}
})
} }
this.items = swiperItems this.items = swiperItems
var slidesWrapperChild = [createElement('div', { var slidesWrapperChild = [createElement('div', {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册