ルーニーマップはvue-awesome-swiperプラグインを使用してプロパティを設定します.

7256 ワード

vue-awesome-swiperプラグインのインストールと使用の設定
インストール
npm install vue-awesome-swiper
cnpm install vue-awesome-swiper  
導入する
グローバル導入:
import vue-awesome-swiper from "vue-awesome-swiper"
import "swiper/dist/css/swiper.css"
コンポーネント方式の導入
import { swiper, swiperSlide } from "vue-awesome-swiper";
 
require("swiper/dist/css/swiper.css");
 
components: {
 
swiper,
 
swiperSlide
 
},
HTMLコード
<swiper :options="swiperOption" class="swiper-box" ref="mySwiper" >
	<swiper-slide class="swiper-item" v-for="(item,index) in activityList" :key="index">
    	<img class="slide-image" :src="item.bannerImageUrl" @click="handleBannerClick(item.activityId)">
    </swiper-slide>
    <div class="swiper-pagination" slot="pagination"></div>
</swiper>
設定項目
data() {
    return {
      swiperOption: {
      	//         ,  notNextTick   true,       NextTick    swiper,                swiper  ,             swiper       ,          true
        notNextTick: true,
        
        autoplay: 6000,//        
        
        grabCursor: true,//      
        
        setWrapperSize: true,
        
        autoHeight: true,
        
        pagination: '.swiper-pagination',
        
        paginationClickable: true,
        
        mousewheelControl: true,
        
        observeParents: true,
        
        autoplayDisableOnInteraction: false  //              
        
        loop:true,//    
        
        speed:800,//    
        
        direction:"horizontal",//    
        
		//           ,     paginationClickable: true,
		 
		pagination: {
		 
		el: ".swiper-pagination",
		 
		clickable: true,
		 
		type: "bullets"
      },
    }