vue2.0引用vue-awesome-swiper插件实现左右滑动轮播效果
来源:互联网 发布:局域网屏幕监控软件 编辑:程序博客网 时间:2024/05/16 12:25
首先需要下载依赖npm install vue-awesome-swiper --save
同时引入css样式
<link rel="stylesheet" href="/static/css/swiper.min.css" charset="utf-8">
<template> <div> <swiper :options="swiperOption" ref="mySwiper"> <!-- 这部分放你要渲染的那些内容 --> <swiper-slide><div class="fd_slide fd_slide1">I'm Slide 1</div></swiper-slide> <swiper-slide><div class="fd_slide fd_slide2">I'm Slide 2</div></swiper-slide> <swiper-slide><div class="fd_slide fd_slide3">I'm Slide 3</div></swiper-slide> <swiper-slide><div class="fd_slide fd_slide4">I'm Slide 4</div></swiper-slide> </swiper> </div></template><script> import { swiper, swiperSlide } from 'vue-awesome-swiper' export default{ components: { swiper, swiperSlide }, data(){ return { swiperOption: { initialSlide:0,//设定初始化时slide的索引 direction:'horizontal',//Slides的滑动方向,可设置水平(horizontal)或垂直(vertical)。 loop: false, //无限滚动 speed:300,//滑动速度 autoplay:100,//自动切换的时间间隔 onSlideChangeEnd: swiper => { //滑动之后回调函数 //切换结束时,告诉我现在是第几个slide console.log('onSlideChangeEnd', swiper.realIndex) } }, } }, }</script><style lang='less'> .fd_slide{ height: 888px; width: 100%; background: red; } .fd_slide1{ background: yellow; } .fd_slide2{ background: red; } .fd_slide3{ background: yellowgreen; } .fd_slide4{ background: orange; }</style>
阅读全文
0 0
- vue2.0引用vue-awesome-swiper插件实现左右滑动轮播效果
- vue.js+vue-awesome-swiper轮播
- vue2.0使用swiper组件实现轮播
- vue-awesome-swiper 自动轮播问题
- vue-awesome-swiper(轮播图vue插件)
- 使用vue-awesome-swiper滑块插件
- 使用vue-awesome-swiper滑块插件
- 使用ViewPager实现左右循环滑动及轮播效果
- vue+swiper 轮播
- vue轮播图插件vue-awesome-swiper的使用
- vue轮播图插件vue-awesome-swiper的使用
- vue轮播图插件vue-awesome-swiper的引入及使用
- vue-awesome-swiper
- vue2封装swiper轮播组件
- ViewPager实现左右循环滑动及轮播效果(广告栏效果)
- 使用swiper插件实现qq聊天窗口按钮滑动效果
- Android使用ViewPager实现左右循环滑动及轮播效果
- Android使用ViewPager实现左右循环滑动及轮播效果
- 论文阅读:How to Construct Deep Recurrent Neural Networks
- 程序的编译链接过程
- python提取文章中的中文数字
- 任学堂说科技:数百万人的噩梦,人工智能将侵蚀银行岗位,从业者该如何自救?
- Linux中的基本网络配置
- vue2.0引用vue-awesome-swiper插件实现左右滑动轮播效果
- Codeforces Round #440 (Div. 2, based on Technocup 2018 Elimination Round 2) 总结
- 任学堂说科技:细思极恐|未来人工智能如何与人类和平相处?
- 树DP [ZJOI2008]骑士
- Excel公式:本年当前周(本周一
- eclipse部署maven web项目到tomcat服务器时,没有将lib、web.xml复制过去的解决办法
- 平常的资源图转Bitmap(太大的资源图不能用这个转)
- 关于儿时的记忆
- 正则表达式 在安卓editText的用法