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>
<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>

View file

@ -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 () {