鍍金池/ 問(wèn)答/HTML/ vue vue-awesome-swiper插件使用分頁(yè)不顯示

vue vue-awesome-swiper插件使用分頁(yè)不顯示

我用vue寫(xiě)一個(gè)輪播圖但是分頁(yè)的圓點(diǎn)沒(méi)有顯示
我的代碼如下:

<template>
  <div class="hello">
    <swiper :options="swiperOption" class="swiper-wrap" v-if="swiper.length" ref="mySwiper">
      <swiper-slide v-for="item in swiper" :key="item.id">
        <img :src="item.imgUrl" alt=""/>
      </swiper-slide>
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
    <v-footer></v-footer>
  </div>
</template>
<script>
import footer from '@/components/footer/footer.vue'
import {swiper, swiperSlide} from 'vue-awesome-swiper'
import infiniteScroll from 'vue-infinite-scroll'
export default {
  name: 'home',
  components: {
    'v-footer': footer,
    swiper,
    swiperSlide
  },
  data () {
    return {
      swiper: [
        {id: 1, imgUrl: '/static/img/home/banner1.png'},
        {id: 2, imgUrl: '/static/img/home/banner.png'},
        {id: 3, imgUrl: '/static/img/home/banner1.png'},
        {id: 4, imgUrl: '/static/img/home/banner.png'}
      ],
      swiperOption: {
        pagination: '.swiper-pagination',
        slidesPerView: 'auto',
        centeredSlides: true,
        paginationClickable: true,
        spaceBetween: 30
      }
    }
  },
  computed: {
    mySwiper () {
      return this.$ref.mySwiper.swiper
    }
  },
  directives: {infiniteScroll}
}
</script>
<style lang="scss">
@import 'static/css/swiper.min';
@import 'static/css/home';
</style>
回答
編輯回答
終相守

先卸載最新的
npm uninstall vue-awesome-swiper

安裝這個(gè)低版本就可以了
npm install vue-awesome-swiper@2.6.7 --save

2018年8月3日 20:07
編輯回答
咕嚕嚕

具體哪個(gè)版本 能說(shuō)下嘛

2017年10月3日 20:33
編輯回答
伴謊

哎,坑,我換了一個(gè)vue-awesome-swiper的低版本,就好用了

2017年8月4日 22:02
編輯回答
老梗

查看一下那幾個(gè)圓點(diǎn)節(jié)點(diǎn)是否存在,存在沒(méi)顯示的話應(yīng)該是層級(jí)或者樣式的問(wèn)題,不存在說(shuō)明沒(méi)有加載或者引入正確。

2017年8月26日 16:47