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 | 10 | </style> |
11 | 11 | <template> |
12 | 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 | 14 | <CarouselItem> |
15 | 15 | <div class="demo-carousel">1</div> |
16 | 16 | </CarouselItem> |
... | ... | @@ -24,6 +24,7 @@ |
24 | 24 | <div class="demo-carousel">4</div> |
25 | 25 | </CarouselItem> |
26 | 26 | </Carousel> |
27 | + <Button @click="value1 = 2">change</Button> | |
27 | 28 | </div> |
28 | 29 | </template> |
29 | 30 | <script> | ... | ... |
src/components/carousel/carousel.vue
... | ... | @@ -307,8 +307,10 @@ |
307 | 307 | this.updatePos(); |
308 | 308 | }, |
309 | 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 | 316 | mounted () { | ... | ... |