vue轮播图实现
1.先安装组件 cnpm install vue-awesome-swiper;
import VueAwsomeSwiper from 'vue-awesome-swiper';
Vue.use(VueAwsomeSwiper);
//创建组件banner.vue
<div>
<swiper :options="swiperOption" :not-next-tick="notNextTick" ref="mySwiper" class="banner">
<swiper-slide v-for="item in listImg"> <a :href="item.linkUrl"><img class="banner-img" :src="item.picUrl" /></a> </swiper-slide <div class="swiper-pagination" slot="pagination"></div> </swiper> </div</template>
<script type="text/ecmascript-6">
import {swiper,swiperSlide} from 'vue-awesome-swiper';
require('swiper/dist/css/swiper.css'); //轮播样式
export default{
props:['listImg'],
data(){
notNextTick:true,
swiperOption:{
autoplay: true,
direction: 'horizontal',
loop:true, grabCursor: true,
setWrapperSize: true,
autoHeight: true,
pagination: '.swiper-pagination',
paginationClickable: true,
mousewheelControl: true,
observeParents: true,
onTransitionStart(swiper) {
console.log(swiper)
}
}
},
computed: {
swiper(){
return this.$refs.mySwiper.swiper;
}
},
mounted(){
this.swiper.slideTo(0, 0, false)
},
components: {
swiper,
swiperSlide
},
}
</script>
-->
vue轮播图实现的更多相关文章
- vue轮播图插件vue-awesome-swiper的使用与组件化
不管是APP还是移动端网页开发,轮播图在大部分项目当中都是存在的,这时候如果用vue开发项目,选择一款好的插件并且封装好是很重要的 1. 推荐使用vue-awesome-swiper 安装:cnpm ...
- vue轮播图
vue开发中遇到这样一个需求实现导航栏和中间内容相结合实现页面滑动导航跟随改变的效果.看效果: 这里我用的是vue所带的插件:vue-awesome-swiper,传送门:https://www.np ...
- Vue轮播图插件---Vue-Awesome-Swiper
轮播图插件 Vue-Awesome-Swiper 地址:https://github.com/surmon-china/vue-awesome-swiper 安装:npm install vue-aw ...
- 做一个vue轮播图组件
根据huangyi老师的慕课网vue项目跟着做的,下面大概记录了下思路 1.轮播图的图 先不做轮播图逻辑部分,先把数据导进来,看看什么效果.在recommend组件新建一个recommends的数组, ...
- vue轮播图插件之vue-awesome-swiper
移动端轮播图插件,在使用iview图形界面插件中的carousel组件无法实现触摸滑动后,转而使用vue-awesome-swiper插件 1.npm安装 npm i vue-awesome-swip ...
- vue --轮播图
轮播图,可以使用mint-ui中的swipe HTML: <Swipe :auto="4000"> <SwipeItem v-for="item in ...
- vue 轮播图插件 vue-awesome-swiper
1.npm安装 npm install vue-awesome-swiper --save 2.vue 引入 //在main.js 中全局引入 import VueAwesomeSwiper from ...
- vue轮播图中间大两头小
<template> <div v-if="items.length" class="full-page-slide-wrapper"> ...
- vue music-抓取歌单列表数据(渲染轮播图)
下载安装新依赖 babel-runtime:对es6语法进行转译 fastclick:对移动端进行点击300毫秒延迟 ,,取消掉 babel-polyfill:API 先添加,在npm install ...
随机推荐
- 【UML】-NO.44.EBook.5.UML.1.004-【UML 大战需求分析】- 顺序图(Sequence Diagram)
1.0.0 Summary Tittle:[UML]-NO.44.EBook.1.UML.1.004-[UML 大战需求分析]- 顺序图(Sequence Diagram) Style:DesignP ...
- 【LeetCode每天一题】Maximum Subarray(最大子数组)
Given an integer array nums, find the contiguous subarray (containing at least one number) which has ...
- upload-labs
upload-labs是一个和sqli-labs类似的靶场平台,只不过是一个专门学习文件上传的.整理的很好,虽然并不能将服务器解析漏洞考虑进去,但毕竟一个靶场不可能多个web容器吧,关键是思路很重要, ...
- linux----------安装Supervisor是用Python开发的一套通用的进程管理程序
1.linux环境必须安装 python 2.yum install python-setuptools 3.获取supervisor包 wget https://pypi.python.org/pa ...
- linux----------今天又遇到一个奇葩的问题,就是linux文件的权限已经是777了但是还是没有写入权限,按照下面的命令就解决了
查看SELinux状态: 1./usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态 SELinux status: ...
- 富文本之BootStrap-wysiwyg 带图片上传功能
BootStrap-wysiwyg插件具有良好的编辑功能和展示效果. 一.使用方法在网上有很多,在此记录自己使用过程中的一些问题和解决方式. 相关依赖: bootstrap-wysiwyg.js (核 ...
- 使用freemarker和itext把html转pdf
1.把html转pdf,首先必须要解决中文显示问题,CSS样式问题以及可能的JS问题,先上例子,自己去体会. 2.先去下载simsun.ttc字体: 2.demo.html <!DOCTYPE ...
- jdk1.8新特性之lambda表达式及在Android Studio中的使用举例
Jdk1.8已经出很久了但是很多同学对它的特性在android studio 中的应用可能还不是很熟悉,今天我们就来对这个新特性在AS中做它的应用实践. 一.首先在有JDK1.8的情况下我们要在AS的 ...
- IP通信基础学习第三周(上)
TCP的连接情况有:同时打开,同时关闭,拒绝连接,异常终止连接. TCP流量控制的折中方法是滑动窗口协议,且TCP标准强烈不赞成发送窗口沿向后缩回. 在滑动窗口中,当A发送了11个字节的数据时,P3- ...
- go get Unknown SSL protocol error in connection to gopkg.in
OSX go get报错 go get Unknown SSL protocol error in connection to gopkg.in https://github.com/niemeyer ...