vue-awesome-swiper中loop设置true无效
### vue-awesome-swiper中loop设置true无效
数据是动态加载的，在网上查不到和我相关的问题答案
是放在子组件中，首页直接引入此swiper子组件的
### 相关代码
```
<div class="wrapper" :class="cname">
    <swiper :options="options">
        <swiper-slide v-for="(item, index) in items" :key="index">
            <slot :src="item"></slot>
        </swiper-slide>
        <div class="swiper-pagination" v-if="options.pagination"  slot="pagination"></div>
    </swiper>
</div>

name: "sliderComponent",
props: {
  cname: {
      type: String,
      default: ""
  },
  options: {
      type: Object,
      default () {
          return {
              autoplay: {
                  delay: 3000,
                  disableOnInteraction: false,
                  //stopOnLastSlide: false
              },
              loop: true,
              pagination: {
                  el: '.swiper-pagination'
              },
              observeParents:true,
              observer:true                 
          }
      }
  },



```
不循环了，轮播到最后一个图就不动了
试了好多次，终极答案是这样：
```
<swiper
  :options="swiperOption"
  ref="mySwiper"
>
  <!-- slides -->
  <swiper-slide
    v-for="(item,index) in topBanner"
    :key="item.id"
  >
  <img
    :src="item.image_url"
    :alt="index"
    class="banner-img"
  >
  </swiper-slide>
</swiper>
```
```
data() {
  return {
    swiperOption: {
      init:false,
      loop: true,
      autoplay: {
        delay: 2000,
        disableOnInteraction: false
      },
    },
  }
}
```
当然，在computed()时要获取$refs:
```
computed: {
  swiper() {
    return this.$refs.mySwiper.swiper;
  }
},
```
然后在vue生命周期的updated()时初始化swiper
```
updated() {
  console.log(this.topBanner);
  if (this.topBanner.length>1) {
    console.log(this.swiper);
    this.swiper.init();
  }
},
```
不用v-if，获取到了this.swiper，问题完美解决