zoukankan      html  css  js  c++  java
  • 48.vue-awesome-swipe使用

    1.安装:npm install vue-awesome-swiper --save

    2.局部引入:

    import "swiper/dist/css/swiper.css";
    import { swiper, swiperSlide } from "vue-awesome-swiper";
    components: {
      swiper,
      swiperSlide
    },
    3.使用:
    <!-- 轮播图 -->
    <div class="swiper">
    <swiper :options="swiperOption" class="swiper-container">
    <!-- slides -->
    <swiper-slide class="swiper-item" v-for="item of swiperList" :key="item.id">
    <img class="swiper-img" :src="item.imgUrl" />
    </swiper-slide>
    <!-- 显示小点-->
    <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
    </div>
    <!-- 轮播图 -->
     
     
     
    data() {
     return {
       swiperOption: {
           pagination: {
              el: ".swiper-pagination",
              clickable: true //点击小圆点
    },
      notNextTick: true,
      loop: true, //循环
      speed: 1000,
      autoplay: true
      // grabCursor: true //小手掌抓取滑动
    },
      //三张轮播,使用变量循环
      swiperList: [
        {
           id: "001",
           bg: "white",
           imgUrl:"https://trade-prod.oss-cn-beijing.aliyuncs.com/paas_shop_static/market_advertiseImage/1550974453867424.jpg"
    },
    {
          id: "002",
          bg: "red",
          imgUrl:
          "https://trade-prod.oss-cn-beijing.aliyuncs.com/paas_shop_static/market_advertiseImage/597831022050017280.jpg"
    }
       ]
      };
    }
  • 相关阅读:
    互联网思维(1)
    互联网思维
    WLAN和WIFI的区别
    ping操作
    一篇关于正则表达式的小结
    javascript正则表达式
    为什么原型继承很重要 – SegmentFault
    JS面向对象基础讲解(工厂模式、构造函数模式、原型模式、混合模式、动态原型
    【转】前端开发文档规范
    我的第一篇博文
  • 原文地址:https://www.cnblogs.com/xlfdqf/p/12053160.html
Copyright © 2011-2022 走看看