carousel.vue
1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<template>
<div>
<Carousel v-model="v1" dots="inside" trigger="hover">
<Carousel-item>
<div class="demo-carousel">1</div>
</Carousel-item>
<Carousel-item>
<div class="demo-carousel">2</div>
</Carousel-item>
<Carousel-item>
<div class="demo-carousel">3</div>
</Carousel-item>
<Carousel-item>
<div class="demo-carousel">4</div>
</Carousel-item>
</Carousel>
{{ v1 }}
<div @click="v1 = 0">change v1</div>
</div>
</template>
<script>
export default {
data () {
return {
v1: 1
}
},
methods: {
push () {
this.pushItem.push('test');
},
slideChange (from, to) {
this.log.push(`From ${from} To ${to}`);
}
}
}
</script>
<style>
.demo-carousel{
height: 200px;
line-height: 200px;
text-align: center;
color: #fff;
font-size: 20px;
background: #506b9e;
}
</style>