Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
* [html5] fix indicator & slider when there's no children.
Browse files Browse the repository at this point in the history
  • Loading branch information
MrRaindrop committed Jun 15, 2017
1 parent f6fe550 commit 569d333
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
8 changes: 1 addition & 7 deletions html5/render/vue/components/slider/indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ function getIndicatorItemStyle (spec, isActive) {
function _render (context, h) {
const children = []
const mergedStyle = extractComponentStyle(context)
// const mergedStyle = context._getComponentStyle(context.$vnode.data)
// context.$vnode.data.cached = {}
// extendKeys(context.$vnode.data.cached, mergedStyle, ['width', 'height'])
const indicatorSpecStyle = extendKeys(
{},
mergedStyle,
Expand Down Expand Up @@ -173,14 +170,11 @@ export default {
active: 0
}
},
// props: {
// count: [Number, String],
// active: [Number, String]
// },
render (createElement) {
const { count, active } = this.$vnode.data.attrs || {}
this.count = count
this.active = active
if (!this.count) { return }
this._renderHook()
return _render(this, createElement)
},
Expand Down
11 changes: 7 additions & 4 deletions html5/render/vue/components/slider/slideMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,13 @@ export default {
const children = this.$children
const len = children && children.length
if (children && len > 0) {
const indicator = children[len - 1]
if (indicator.$options._componentTag === 'indicator'
|| indicator.$vnode.data.ref === 'indicator') {
indicator._watcher.get()
for (let i = 0; i < len; i++) {
const vm = children[i]
if (vm.$options._componentTag === 'indicator'
|| vm.$vnode.data.ref === 'indicator') {
vm._watcher.get()
break
}
}
}
fireLazyload(this.$el, true)
Expand Down

0 comments on commit 569d333

Please sign in to comment.