轮播图插件
Vue-Awesome-Swiper
地址:https://github.com/surmon-china/vue-awesome-swiper
安装:npm install vue-awesome-swiper --save
局部引入:
import 'swiper/dist/css/swiper.css'
import { swiper, swiperSlide } from 'vue-awesome-swiper' export default {
components: {
swiper,
swiperSlide
}
}
全局引入:
import Vue from 'vue'
import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css' Vue.use(VueAwesomeSwiper, /* { default global options } */)

使用方法:

<swiper :options="swiperOption">
<swiper-slide><img src="static/images/jay.jpg"></swiper-slide>
<swiper-slide><img src="static/images/jay.jpg"></swiper-slide>
<swiper-slide><img src="static/images/jay.jpg"></swiper-slide>
</swiper>
<!--以下看需要添加-->
<div class="swiper-scrollbar"></div> //滚动条
<div class="swiper-button-next"></div> //下一项
<div class="swiper-button-prev"></div> //上一项
<div class="swiper-pagination"></div> //标页码
<script>
import 'swiper/dist/css/swiper.css'
import { swiper, swiperSlide } from 'vue-awesome-swiper'
export default {
data(){
return {
//设置属性
swiperOption:{
//显示分页
pagination: {
el: '.swiper-pagination',
clickable:true
},
//切换模式 横屏或者竖屏
// direction : 'vertical',
//设置自动播放速度
autoplay: {
disableOnInteraction: false,
delay:4000
},
//开启无限循环
loop:true,
//设置点击箭头
paginationClickable :true,
prevButton:'.swiper-button-prev',
nextButton:'.swiper-button-next',
//设置同屏显示的数量,默认为1,使用auto是随意的意思。
slidesPerView:1,
//开启鼠标滚轮控制Swiper切换。可设置鼠标选项,或true使用默认值。
mousewheel:true ,
//默认为false,普通模式:slide滑动时只滑动一格,并自动贴合wrapper,设置为true则变为free模式,slide会根据惯性滑动可能不止一格且不会贴合。
// freeMode:true
}
}
},
components:{
swiper,
swiperSlide
}
}
</script>

Vue轮播图插件---Vue-Awesome-Swiper的更多相关文章

  1. vue轮播图插件之vue-awesome-swiper

    移动端轮播图插件,在使用iview图形界面插件中的carousel组件无法实现触摸滑动后,转而使用vue-awesome-swiper插件 1.npm安装 npm i vue-awesome-swip ...

  2. vue轮播图插件vue-awesome-swiper的使用与组件化

    不管是APP还是移动端网页开发,轮播图在大部分项目当中都是存在的,这时候如果用vue开发项目,选择一款好的插件并且封装好是很重要的 1. 推荐使用vue-awesome-swiper 安装:cnpm ...

  3. vue 轮播图插件 vue-awesome-swiper

    1.npm安装 npm install vue-awesome-swiper --save 2.vue 引入 //在main.js 中全局引入 import VueAwesomeSwiper from ...

  4. 原生js写一个无缝轮播图插件(支持vue)

    轮播图插件(Broadcast.js) 前言:写这个插件的原因 前段时间准备用vue加上网易云的nodejs接口,模拟网易云音乐移动端.因为想自己写一遍所有的代码以及加固自己的flex布局,所以没有使 ...

  5. js 原生轮播图插件

    <!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  6. jquery, js轮播图插件Swiper3

    轮播图插件Swiper3 HTML代码 如果只是简单的使用轮播图,直接复制我的html代码就可以. 如果想要高级一些,就自己去看文档吧 <!DOCTYPE html> <html l ...

  7. 学习笔记: js插件 —— SuperSlide 2 (轮播图插件,PC用)

    SuperSlide 2  轮播图插件,较老.但还好用. 适用于PC,是绑定到jquery上的方法: $.slide(); 如果在实际中找不到.slide方法,请检查jquery等.js文件的引入次序 ...

  8. 封装一个简单的原生js焦点轮播图插件

    轮播图实现的效果为,鼠标移入左右箭头会出现,可以点击切换图片,下面的小圆点会跟随,可以循环播放(为了方便理解,没有补2张图做无缝轮播).本篇文章的主要目的是分享封装插件的思路. 轮播图我一开始是写成非 ...

  9. jquery的fadeTo方法的淡入淡出轮播图插件

    由于对基于jquery的简单插件开发有了一定的了解,慢慢的也对基于jquery的插件开发有了兴趣,在上班结束之后就研究各种插件的思路逻辑.最近开发了一款基于jquery的fadeTo方法的轮播图插件, ...

随机推荐

  1. jenkins 自动化部署

    Execute shell Command BUILD_ID=DONTKILLMEif [ ! -d "/usr/jenkins/$JOB_NAME" ]; then mkdir ...

  2. docker 下载镜像 ( 以 mysql为例 )

    一.官方镜像仓库 https://hub.docker.com/explore/ 二.常用操作 三.使用命令查看 mysql [root@localhost fw]# docker search my ...

  3. CF787A - The Monster

    /* CF787A - The Monster http://codeforces.com/contest/787/problem/A 数学 扩展欧几里得 注意x或y为0的时候要特判 并且结果要大于b ...

  4. Oracle解除表锁定问题

    1.肯定是你同时打开了多个操作页面,要记得关闭多个打开的sql窗口. 2.可以变相删除表,再重新创建一张同名的表来解除表被锁住的问题

  5. HDU 5168

    把边按权值排序后,就相当于求一个子序列以1开始和以n结束.由于边权递增,而且相差>=k,所以,边的顺序也必定是递增的.知道,当处理一条出边时,必定是从入边选择一条最优的边,考虑两个因素,入边的权 ...

  6. [Ionic] Align and Size Text with Ionic CSS Utilities

    The Ionic framework provides several built-in CSS Utilities or directives that you can leverage when ...

  7. DOMContentLoaded事件<zz>

    今天查看百度空间源代码,发现多了个util.js文件,打开看看.里面里面定义了addDOMLoadEvent.这是干什么用的? 仔细查看代码,发现在Mozilla添加了DOMContentLoaded ...

  8. c++中字符输入函数getline、cin.getline区分

    1.cin>>s; s能够是:string  s.char s[]; 这个是ostream中的函数.遇到' '(空格) , '\n'(换行),就会自己主动结束,因此假设用cin读取字符串, ...

  9. UVA 1515 Pool construction 最大流跑最小割

    Pool construction You are working for the International Company for Pool Construction, a constructio ...

  10. 0x03 递归

    这个东西好像在搞矩乘的时候用过?忘了 #include<cstdio> #include<iostream> #include<cstring> #include& ...