Blame view

src/components/carousel/carousel-item.vue 727 Bytes
6c9acb08   Rijn   initialize carousel
1
  <template>
bfc11079   Rijn   updated autoplay ...
2
      <div :class="prefixCls" v-bind:style="styles"><slot></slot></div>
6c9acb08   Rijn   initialize carousel
3
4
5
6
7
  </template>
  <script>
      const prefixCls = 'ivu-carousel-item';
  
      export default {
65c64ce9   Rijn   carousel basic po...
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
          componentName: 'carousel-item',
  
          data () {
              return {
                  prefixCls: prefixCls,
                  width: 0,
                  left: 0
              };
          },
          computed: {
              styles () {
                  return {
                      width: `${this.width}px`,
                      left: `${this.left}px`
                  }
              }
          },
8f4e2cf0   Rijn   update pos when s...
25
          compiled () {
373dfb3c   Rijn   removed observer
26
27
28
29
              this.$parent.slotChange();
          },
          beforeDestroy () {
              this.$parent.slotChange();
8f4e2cf0   Rijn   update pos when s...
30
          }
6c9acb08   Rijn   initialize carousel
31
32
      };
  </script>