Browse Source

Carousel: Fix onChange emit value (#16705)

iamkun 6 years ago
parent
commit
484a033a66
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/carousel/src/main.vue

+ 3 - 1
packages/carousel/src/main.vue

@@ -148,7 +148,9 @@ export default {
 
     activeIndex(val, oldVal) {
       this.resetItemPosition(oldVal);
-      this.$emit('change', val, oldVal);
+      if (oldVal > -1) {
+        this.$emit('change', val, oldVal);
+      }
     },
 
     autoplay(val) {