Explorar o código

carousel: be able to switch autoplay state

Geeku %!s(int64=8) %!d(string=hai) anos
pai
achega
39564cb7e8
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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();
     }
   },