Commit 5528967c633746ca7f09350c651fcaa587ddb533
1 parent
bbf4ee22
fixed #3506
Showing
2 changed files
with
6 additions
and
3 deletions
Show diff stats
examples/routers/carousel.vue
@@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
10 | </style> | 10 | </style> |
11 | <template> | 11 | <template> |
12 | <div style="width: 400px;"> | 12 | <div style="width: 400px;"> |
13 | - <Carousel loop arrow="always" @on-change="handleChange"> | 13 | + <Carousel v-model="value1" loop arrow="always" @on-change="handleChange"> |
14 | <CarouselItem> | 14 | <CarouselItem> |
15 | <div class="demo-carousel">1</div> | 15 | <div class="demo-carousel">1</div> |
16 | </CarouselItem> | 16 | </CarouselItem> |
@@ -24,6 +24,7 @@ | @@ -24,6 +24,7 @@ | ||
24 | <div class="demo-carousel">4</div> | 24 | <div class="demo-carousel">4</div> |
25 | </CarouselItem> | 25 | </CarouselItem> |
26 | </Carousel> | 26 | </Carousel> |
27 | + <Button @click="value1 = 2">change</Button> | ||
27 | </div> | 28 | </div> |
28 | </template> | 29 | </template> |
29 | <script> | 30 | <script> |
src/components/carousel/carousel.vue
@@ -307,8 +307,10 @@ | @@ -307,8 +307,10 @@ | ||
307 | this.updatePos(); | 307 | this.updatePos(); |
308 | }, | 308 | }, |
309 | value (val) { | 309 | value (val) { |
310 | - this.currentIndex = val; | ||
311 | - this.trackIndex = val; | 310 | +// this.currentIndex = val; |
311 | +// this.trackIndex = val; | ||
312 | + this.updateTrackIndex(val); | ||
313 | + this.setAutoplay(); | ||
312 | } | 314 | } |
313 | }, | 315 | }, |
314 | mounted () { | 316 | mounted () { |