You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by so...@apache.org on 2017/06/22 05:27:12 UTC
[07/50] [abbrv] incubator-weex git commit: * [html5] fix slider's
error when there's no children at first.
* [html5] fix slider's error when there's no children at first.
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/f6fe550b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/f6fe550b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/f6fe550b
Branch: refs/heads/dev
Commit: f6fe550b79967243e26ddd2bf8f96a48c44a9522
Parents: 3471c85
Author: MrRaindrop <te...@gmail.com>
Authored: Thu Jun 15 11:45:57 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Thu Jun 15 11:45:57 2017 +0800
----------------------------------------------------------------------
html5/render/vue/components/slider/slideMixin.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f6fe550b/html5/render/vue/components/slider/slideMixin.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/slider/slideMixin.js b/html5/render/vue/components/slider/slideMixin.js
index 2655fbb..84ca705 100644
--- a/html5/render/vue/components/slider/slideMixin.js
+++ b/html5/render/vue/components/slider/slideMixin.js
@@ -59,7 +59,6 @@ export default {
}
}
fireLazyload(this.$el, true)
- this._preIndex = this._showNodes[0].index
if (this._preIndex !== this.currentIndex) {
this._slideTo(this.currentIndex)
}
@@ -162,6 +161,9 @@ export default {
},
_slideTo (index, isTouchScroll) {
+ if (this.frameCount <= 0) {
+ return
+ }
if (!this.infinite || this.infinite === 'false') {
if (index === -1 || index > (this.frameCount - 1)) {
this._slideTo(this.currentIndex)