https://surmon-china.github.io/vue-awesome-swiper/

第一步安装

npm install vue-awesome-swiper --save

第二部在main.js中引入

import Vue from 'vue'
import VueAwesomeSwiper from 'vue-awesome-swiper'
Vue.use(VueAwesomeSwiper)
 
在组件中使用插件
<swiper :options="swiperOption"  ref="mySwiper">
<!-- 这部分放你要渲染的那些内容 -->
<swiper-slide v-for="item in items">
<img :src="item" class="index_img">
</swiper-slide>
<!-- 这是轮播的小圆点 -->
<div class="swiper-pagination" slot="pagination"></div>
</swiper>
import { swiper, swiperSlide } from 'vue-awesome-swiper'
export default{
name:'index',
components: {
swiper,
swiperSlide
},
data() {
return {
items:['../static/bg4.jpg','../static/bg5.jpg','../static/bg7.jpg'],
swiperOption: {
pagination: '.swiper-pagination',
slidesPerView: 'auto',
centeredSlides: true,
paginationClickable: true,
onSlideChangeEnd: swiper => {
//这个位置放swiper的回调方法
this.page = swiper.realIndex+1;
this.index = swiper.realIndex;
},
},
swiperSlides: [1, 2, 3, 4, 5]
}
},
//定义这个sweiper对象
computed: { swiper() {
return this.$refs.mySwiper.swiper;
}
},
mounted () {
//这边就可以使用swiper这个对象去使用swiper官网中的那些方法
//this.swiper.slideTo(0, 0, false);
} }

vue轮播插件vue-awesome-swiper的更多相关文章

  1. vue 轮播插件使用

    <template> <div> <Swiper ref="swiper" v-if="list.length > 0" : ...

  2. 【swiper轮播插件】解决swiper轮播插件触控屏问题

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

  3. 后盾网lavarel视频项目---Vue项目使用vue-awesome-swiper轮播插件

    后盾网lavarel视频项目---Vue项目使用vue-awesome-swiper轮播插件 一.总结 一句话总结: vue中的插件的使用和js插件的使用一样的简单,只是vue插件的引入过程有些不同 ...

  4. vue轮播(完整详细版)

    轮播组件vue <swiper :options="swiperOption" class='swiper-box'>     <swiper-slide v-f ...

  5. vue轮播,不是只有左右切换的,还有只切换src的

    在项目中,初次接触vue,看了轮播插件vue-swiper等,好多都是左右切换的.个人强迫症比较严重,就要单页切换样式,就手写了一个. 功能:自动轮播,上一页下一页,点击小圆点切换大图.基本轮播要求的 ...

  6. 使用Swiper轮播插件引起的探索

    提到Swiper轮播插件,小伙伴们应该不会感到陌生.以前我主要在移动端上使用,PC端使用较少. 注:这里需要注意的是,在PC端和移动端使用Swiper是不同的 官方给的版本有三个,分别是Swiper2 ...

  7. 一款好用的轮播插件swiper,适用于移动端和web

    swiper的dom布局 <div id="commentsSwiper" class="swiper-container"> <div cl ...

  8. vue轮播,展示pdf

    vue轮播,展示pdf 根据左侧图片格式,右侧展示相应的pdf文件与图片.(vue中不支持pdf格式,pdf文件要放在static文件里):代码如下: <template> <!-- ...

  9. Javascript和jQuery WordPress 图片轮播插件, 内容滚动插件,前后切换幻灯片形式显示

    用于在有限的网页空间内展示一组产品图片或者照片,同时还有非常吸引人的动画效果.本文向大家推荐12款实用的 jQuery 图片轮播效果插件,帮助你在你的项目中加入一些效果精美的图片轮播效果,希望这些插件 ...

随机推荐

  1. Android showDialog时报错requestFeature() must be called before adding content

    View view = View.inflate(this, R.layout.layout_dialog, null); AlertDialog alertDialog = new AlertDia ...

  2. Protected vs protected internal (Again) in c#

    http://stackoverflow.com/questions/22940317/protected-vs-protected-internal-again-in-c-sharp protect ...

  3. B1877 [SDOI2009]晨跑 费用流

    其实之前写过一个板子,但是一点印象都没有,所以今天重写了一下,顺便把这个题当成板子就行了. 其实费用流就是把bfs换成spfa,但是中间有一个原则,就是费用优先,在费用(就是c)上跑spfa,顺便求出 ...

  4. C# MySql Select

    MySqlCommand objCmd = new MySqlCommand("select * from `main_db`.`t_realdailyinfo` ", objCo ...

  5. [Swift通天遁地]七、数据与安全-(1)XML文档的创建和解析

    ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs. ...

  6. ASP.NET MVC5 之 AspNetUsers 表增加字段

    MVC5 执行数据库迁移时,会生成一些默认的数据表,但是在实际的工作中.若用到的时候,难免要增添一些字段. 1.AspNetUsers 增加字段 A.打开MVC中的 IdentityModels.cs ...

  7. fieldset ----- 不常用的HTML标签

    fieldset 元素可将表单内的相关元素分组. <fieldset> 标签将表单内容的一部分打包,生成一组相关表单的字段. 当一组表单元素放到 <fieldset> 标签内时 ...

  8. Android 检查手机上是否安装了指定的软件(根据包名检测)

    Android检查手机上是否安装了指定的软件(根据包名检测) /** * 检查手机上是否安装了指定的软件 * @param context * @param packageName * @return ...

  9. 初学layer

    canvas是支持图层layer渲染这种技术的,canvas默认就有一个layer,当我们平时调用canvas的各种drawXXX()方法时,其实是把所有的东西都绘制到canvas这个默认的layer ...

  10. 接口测试(一)--soapui实践

    一.接口的概念 接口是指系统模块与模块或系统与系统之间进行交互,一般用的多的是HTTP协议的接口.webService协议的接口,还有RPC的接口. RPC:Remote Procedure Call ...