Browse Source

carousel: be able to switch autoplay state

Geeku 8 years ago
parent
commit
39564cb7e8
1 changed files with 4 additions and 0 deletions
  1. 4 0
      packages/carousel/src/main.vue

+ 4 - 0
packages/carousel/src/main.vue

@@ -109,6 +109,10 @@ export default {
     activeIndex(val, oldVal) {
       this.resetItemPosition();
       this.$emit('change', val, oldVal);
+    },
+
+    autoplay(val) {
+      val ? this.startTimer() : this.pauseTimer();
     }
   },