From 5528967c633746ca7f09350c651fcaa587ddb533 Mon Sep 17 00:00:00 2001 From: 梁灏 <admin@aresn.com> Date: Thu, 28 Jun 2018 18:09:22 +0800 Subject: [PATCH] fixed #3506 --- examples/routers/carousel.vue | 3 ++- src/components/carousel/carousel.vue | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/routers/carousel.vue b/examples/routers/carousel.vue index aba3599..d947f20 100644 --- a/examples/routers/carousel.vue +++ b/examples/routers/carousel.vue @@ -10,7 +10,7 @@ </style> <template> <div style="width: 400px;"> - <Carousel loop arrow="always" @on-change="handleChange"> + <Carousel v-model="value1" loop arrow="always" @on-change="handleChange"> <CarouselItem> <div class="demo-carousel">1</div> </CarouselItem> @@ -24,6 +24,7 @@ <div class="demo-carousel">4</div> </CarouselItem> </Carousel> + <Button @click="value1 = 2">change</Button> </div> </template> <script> diff --git a/src/components/carousel/carousel.vue b/src/components/carousel/carousel.vue index c412b93..9255036 100644 --- a/src/components/carousel/carousel.vue +++ b/src/components/carousel/carousel.vue @@ -307,8 +307,10 @@ this.updatePos(); }, value (val) { - this.currentIndex = val; - this.trackIndex = val; +// this.currentIndex = val; +// this.trackIndex = val; + this.updateTrackIndex(val); + this.setAutoplay(); } }, mounted () { -- libgit2 0.21.4