main.js
import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'
Vue.use(VueAwesomeSwiper) 组件
<template>
<div id="container">
<swiper :options="swiperOption" ref="mySwiper"> <swiper-slide v-for="(item,index) in swipes">
<img :src="item.picUrl" >
</swiper-slide>
<p class="swiper-pagination" slot="pagination"></p>
</swiper>
</div>
</template>
<script>
import { swiper, swiperSlide } from 'vue-awesome-swiper'
export default {
name: 'carrousel',
props:["swipes"],
data () {
return {
swiperOption: {
autoplay : {
disableOnInteraction: false, //用户操作后是否禁止自动循环
delay: //自自动循环时间
}, //可选选项,自动滑动
speed: , //切换速度,即slider自动滑动开始到结束的时间(单位ms)
loop:true, //循环切换
grabCursor: true, //设置为true时,鼠标覆盖Swiper时指针会变成手掌形状,拖动时指针会变成抓手形状
// setWrapperSize: true, //Swiper使用flexbox布局(display: flex),开启这个设定会在Wrapper上添加等于slides相加的宽或高,在对flexbox布局的支持不是很好的浏览器中可能需要用到。
autoHeight: true, //自动高度。设置为true时,wrapper和container会随着当前slide的高度而发生变化。
scrollbar: '.swiper-scrollbar',
mousewheelControl: true, //设置为true时,能使用鼠标滚轮控制slide滑动
observeParents: true, //当改变swiper的样式(例如隐藏/显示)或者修改swiper的子元素时,自动初始化swiper
pagination: {
el: '.swiper-pagination',
// type : 'progressbar', //分页器形状
clickable :true, //点击分页器的指示点分页器会控制Swiper切换
}, },
computed: {
swiper() {
return this.$refs.mySwiper.swiper
}
}
}
}
}
</script>
<style scoped>
.swiper-slide{
width:%;
height:150px;
}
img {
width: %;
height: auto;
}
</style>

vue awaresome swiper的使用的更多相关文章

  1. vue引入swiper vue使用swiper vue脚手架使用swiper /引入js文件/引入css文件

    vue引入swiper  vue使用swiper  vue脚手架使用swiper /引入js文件/引入css文件 ------------------------------------------- ...

  2. Vue与swiper想结合封装全屏轮播插件

    项目需求介绍: 1.页面图文混排, 2.点击图片后全屏展示图片,并在底部显示文字,如果没有则不显示 3.关闭全屏后依然停留在上次浏览的位置 4.浏览图片时,不管点击的哪张图片,全屏展示的时候也要显示这 ...

  3. vue 使用swiper的一些问题(页面渲染问题)

    //Swiper上下滚动初始化 swiper_init(){ this.$nextTick(function(){ var mySwiper = new Swiper ('.swiper-contai ...

  4. 小程序和Vue利用swiper实现icons分页显示--动态计算

    这里发现小程序实现步骤,Vue与之类似 先上效果图: <view class="icons"> <swiper indicator-dots="true ...

  5. vue使用swiper模块滑动时报错:[Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example becaus

    报错: vue报这个错 [Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for ex ...

  6. 轮播模仿臭美APP,vue,swiper

    介绍:轮播使用了swiper,重要用于移动端滑动,详情可查看官网 1.首先用npm安装        npm install swiper 2.main.js 中引入CSS     import 's ...

  7. vue封装swiper

    参考:https://github.com/surmon-china/vue-awesome-swiper npm install vue-awesome-swiper --save 全局引入 imp ...

  8. vue添加swiper的正确方式亲测---切图网

    在vue项目中,我们在做图片轮播的方式和传统切图不同,传统切图中我们一般采用非常强大的swiper来完成,而在vue中一般依赖vue-awesome-swiper组件来完成(vue-awesome-s ...

  9. Vue整合swiper报错Could not compile template .....swiper\dist\css\swiper.css解决办法

    问题描述 今天做一个前端项目,安装幻灯片插件vue-awesome-swiper后 运行npm run dev 后报错如下: `ERROR Could not compile template E:\ ...

随机推荐

  1. ubuntu安装配置ApachePhpMysql

    1.安装之前先sudo源 sudo apt update 2.安装Apache2 sudo apt install apache2 3.更改默认目录: vi /etc/apache2/apache2. ...

  2. C++经典问题:狐狸找兔子

    问题描述: 围绕着山顶有10个洞,一只狐狸和一只兔子住在各自的洞里.狐狸想吃掉兔子.一天,兔子对狐狸说:"你想吃我有一个条件,先把洞从1-10编上号,你从10号洞出发,先到1号洞找我:第二次 ...

  3. DOS查看端口占用及杀掉进程命令

    转载自:http://www.cnblogs.com/rainman/p/3457227.html 1. 查看端口占用 在windows命令行窗口下执行: netstat -aon|findstr & ...

  4. Java Learning 001 新建一个Java工程 HelloWorld程序

    Java Learning 001 新建一个Java工程 HelloWorld程序 Step 1 . 在Eclipse 软件里,点击: File -> New -> Java Projec ...

  5. error C2039: “addTextureMesh”: 不是“pcl::visualization::PCLVisualizer”的成员

    error C2039: "addTextureMesh": 不是"pcl::visualization::PCLVisualizer"的成员 PCL 1.6 ...

  6. hadoop job 重要性能参数

    name 说明 mapred.task.profile 是否对任务进行profiling,调用java内置的profile功能,打出相关性能信息 mapred.task.profile.{maps|r ...

  7. 在命令行上启动genymotion虚拟机

    自从有了genymotion,多机联调就解放了,一台电脑运行两个genymotion虚拟机毫无压力,不过也看用的是哪种os image,之前我以为google自己的Nexus应该最适应,哪知道开起来比 ...

  8. 常用转义字符例如&amp;的含义

    &amp中的amp就是英文ampersand的缩写,该词的意思是&这个符号& 是 HTML 中 & 的表示方法.即在html中用&表示&符号

  9. webconfig配置详解--转

    花了点时间整理了一下ASP.NET Web.config配置文件的基本使用方法.很适合新手参看,由于Web.config在使用很灵活,可以自定义一些节点.所以这里只介绍一些比较常用的节点. <? ...

  10. sqlserver2012——SqlCommand创建对象的三种方法

    1.使用不带参构造函数 SqlCommand cmd = new SqlCommand(); cmd.Connection = SqlConnnection对象: cmd.CommandText=Sq ...