Blame view

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