一、安装
npm install swiper vue-awesome-swiper@v3.2.0 --save

二、页面引入

*这里说明一下:完全不用在main.js写那些没用的,仅需要当前组件或者页面引入一下就行

import { Swiper } from "vue-awesome-swiper";
import 'swiper/dist/css/swiper.css'

三、详细

         <div class="swiper-container swiper-no-swiping"><div class="swiper-wrapper"><div class="swiper-slide" v-for="item of swiperList" :key="item.index" ><div class="clearFix"><img :src="item.imgUrl" /></div><p>{{item.txt}}</p></div></div><!-- 分页符 --><div class="swiper-pagination"></div><!-- 前进后退按钮 --><div class="swiper-button-prev"></div><div class="swiper-button-next"></div></div>
<script>
import { Swiper } from "vue-awesome-swiper";
import 'swiper/dist/css/swiper.css'
export default {name: 'index',data () {return {swiperList: [{id:"1",title:"###",imgUrl: require('../assets/images/1_03.jpg'),txt:"###"},{id:"2",title:"###",imgUrl: require('../assets/images/1_03.jpg'),txt:"###"},],}},mounted(){this.mySwiper=  new Swiper('.swiper-container', {autoplay: true,    //自动播放loop: true,        //循环播放wdelay: 3000,       //每张图间隔三秒//分页器pagination: {el: ".swiper-pagination"},//左右前进后退按钮navigation: {nextEl: ".swiper-button-next",prevEl: ".swiper-button-prev"}});},}<script>
.mainCont .swiper-container{position: relative;width: 300px;height: 138px;overflow: hidden;}
.mainCont .swiper-container .swiper-slide{width:100%;height: 138px}
.mainCont .swiper-container .swiper-slide img{width: 100%;margin-bottom: 30px;float: left}
.mainCont .swiper-container .swiper-slide p{font-size: 42px;line-height: 66px;color: #333}

vue 使用 vue-awesome-swiper(swiper)解决方法相关推荐

  1. vue 报错unknown custom element解决方法

    vue 报错unknown custom element解决方法 参考文章: (1)vue 报错unknown custom element解决方法 (2)https://www.cnblogs.co ...

  2. vue v-html 动态内容样式无效解决方法

    vue v-html 动态内容样式无效解决方法 参考文章: (1)vue v-html 动态内容样式无效解决方法 (2)https://www.cnblogs.com/mengfangui/p/122 ...

  3. eslint 验证vue文件 报错 unexpected token =解决方法

    eslint 验证vue文件 报错 unexpected token =解决方法 参考文章: (1)eslint 验证vue文件 报错 unexpected token =解决方法 (2)https: ...

  4. vue IE下验证码无法显示解决方法

    vue IE下验证码无法显示解决方法 使用axios进行get请求,返回格式为文件流可以使用一下方法解决 axios({method: 'get',url: '/verifyCode/authImag ...

  5. Better Scroll+Vue、div的@click无效解决方法

    better-scroll+Vue.div的@click无效解决方法 正常情况,div可以直接点击 <template><div><div @click="di ...

  6. Vue packages version mismatch 报错解决方法

    一般的解决方法是更新vue到与vue-template-compiler同版本. 检查一年package.json中关于两者的配置是否相同,若不同,修改成一样即可. 注意: 关于^和~说明: (1)指 ...

  7. ant vue 兼容性问题_Ant Design of Vue使用遇到的问题以及解决方法总结

    解决方法:将参数 destroyOnClose 设置为true,表示当关闭时自动销毁Modal的子元素. 问题2:控件select的备选项option标签属性key和value值的区别? 解决方法: ...

  8. vue 导入element-ui css报错解决方法

    组件使用参照官网http://element.eleme.io/#/zh-CN/component/quickstart 在 main.js 中写入以下内容: 1 2 3 4 5 6 import V ...

  9. vue搜不到c_vue不是内部命令、安装@vue/cli失败、找不到vue.cmd文件等问题的解决方法...

    最近打算用vue-cli写项目,发现用官网提供的安装方式npm install @vue/cli -g怎么都安装不上,一直报如下错误 EPERM: operation not permitted, r ...

  10. 安装vue/cli的一些警告的解决方法

    一.vue/cli 1.npm WARN vue-virtual-scroller@1.0.0-rc.2 requires a peer of vue@^2.5.21 but none is inst ...

最新文章

  1. 18.2 keepalived介绍
  2. “开源”将成为物联网开发生态链的标准
  3. 基于Springboot实现医院HIS信息管理系统
  4. mac下常用快捷键整理
  5. Bzoj 2749: [HAOI2012]外星人 欧拉函数,数论,线性筛
  6. 最短路径次短路径算法
  7. UOJ#454-[UER #8]打雪仗【通信题】
  8. Java 文件 IO 操作
  9. dev里timeedit控件如何赋值_如何制作高逼格的数据地图(二)
  10. 整人VBS\BAT代码 ② 整蛊系列→可参考
  11. 从零到一搭建Kconfig配置系统
  12. 网络可视化工具netron详细安装流程
  13. window7系统下如何使用虚拟机安装苹果系统
  14. asp.net core 防止机密信息外泄GitHub
  15. VS2015编译时“ The POSIX name for this item is deprecated.”的分析
  16. CSDN 学习勋章获得攻略
  17. linux脚本简介,Linux Shell脚本简介
  18. 使用栈实现中缀表达式转后缀表达式
  19. 【windows2008R2问题2】Windows Server® 2008 Enterprise 组件服务 找不到 ”Microsoft Word 97 - 2003 文档“组件...
  20. xm-select 原始数据的回显及修改

热门文章

  1. 微博商业数据挖掘方法
  2. 《学习 Go 语言》学习心得
  3. 金融、银行业务了解(自我盲点整理)
  4. 蓝牙相关学习:5.BLE协议属性协议层(ATT)
  5. java读取欧姆龙plc,寄存器读取命令响应超时 欧姆龙plc寄存器读取命
  6. 那些年我们一起追过的稀奇古怪的SQL
  7. 根据指定日期获取该日期所在周的所有日期
  8. 爱有很多种,但一不小心就会失去……
  9. Microsoft Office Home and Student Edition 2013 All-in-One For Dummies 免积分下载
  10. mtk平台dump系统分区