This commit is contained in:
梁灏 2018-06-28 18:09:22 +08:00
parent bbf4ee223f
commit 5528967c63
2 changed files with 6 additions and 3 deletions

View file

@ -10,7 +10,7 @@
</style> </style>
<template> <template>
<div style="width: 400px;"> <div style="width: 400px;">
<Carousel loop arrow="always" @on-change="handleChange"> <Carousel v-model="value1" loop arrow="always" @on-change="handleChange">
<CarouselItem> <CarouselItem>
<div class="demo-carousel">1</div> <div class="demo-carousel">1</div>
</CarouselItem> </CarouselItem>
@ -24,6 +24,7 @@
<div class="demo-carousel">4</div> <div class="demo-carousel">4</div>
</CarouselItem> </CarouselItem>
</Carousel> </Carousel>
<Button @click="value1 = 2">change</Button>
</div> </div>
</template> </template>
<script> <script>

View file

@ -307,8 +307,10 @@
this.updatePos(); this.updatePos();
}, },
value (val) { value (val) {
this.currentIndex = val; // this.currentIndex = val;
this.trackIndex = val; // this.trackIndex = val;
this.updateTrackIndex(val);
this.setAutoplay();
} }
}, },
mounted () { mounted () {