提交 558079be 编写于 作者: 郭胜强

修复swiper组件内未包含子组件时导致异常的问题

上级 eb0b9ade
node_modules/
.project
unpackage/
\ No newline at end of file
unpackage/
.vscode/
\ No newline at end of file
......@@ -552,21 +552,23 @@ export default {
var slidesDots = []
var index = 0
var swiperItems = []
this.$slots.default.forEach(vnode => {
if (vnode.componentOptions && vnode.componentOptions.tag === 'v-uni-swiper-item') {
swiperItems.push(vnode)
slidesDots.push(createElement('div', {
class: {
'uni-swiper-dot': true,
'uni-swiper-dot-active': index === this.currentSync
},
style: {
'background': index === this.currentSync ? this.indicatorActiveColor : this.indicatorColor
}
}))
index++
}
})
if (this.$slots.default) {
this.$slots.default.forEach(vnode => {
if (vnode.componentOptions && vnode.componentOptions.tag === 'v-uni-swiper-item') {
swiperItems.push(vnode)
slidesDots.push(createElement('div', {
class: {
'uni-swiper-dot': true,
'uni-swiper-dot-active': index === this.currentSync
},
style: {
'background': index === this.currentSync ? this.indicatorActiveColor : this.indicatorColor
}
}))
index++
}
})
}
this.items = swiperItems
var slidesWrapperChild = [createElement('div', {
ref: 'slides',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册