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. Javascript之一切皆为对象1
  2. 修改Hosts后对火狐不起作用解决办法
  3. Android 动画机制与使用技巧
  4. OC - 8.Quartz2D核心要点
  5. swift2.0 UIImagePickerController 拍照 相册 录像
  6. 制作iis自动安装包
  7. UILabel的讲解
  8. eclipse导入包之后中文乱码
  9. os和sys模块的区别及其常用方法总结
  10. Nginx接收的host值会影响alias的规则匹配
  11. Docker之数据卷Volume(七)
  12. sitecore系统教程之架构概述
  13. Leetcode 1004. 最大连续1的个数 III
  14. Linux常用基本命令( rmdir, rm, mv )
  15. ListView单条刷新的方法
  16. 从Java的堆栈到Equals和==的比較
  17. maven 统一管理依赖的版本号
  18. 转载: crypto:start() 错误。
  19. STL中 map 和 multimap
  20. 移动端适配插件(flexible.js)

热门文章

  1. Io 异常: Invalid number format for port number
  2. 第05组 团队Git现场编程实战
  3. STL 二分查找
  4. 学好Python后可从事岗位+学习Python的难度
  5. mysql实现行转列功能
  6. 第02组 Alpha冲刺(3/6)
  7. js 压缩图片(只缩小体积,不更改图片尺寸)
  8. c# 自定义按钮,渐变颜色(含中心向四周渐变,单方向渐变)
  9. Java stream 并发应用案例
  10. 小米win10+kali 双系统