vue2.0使用swiper组件实现轮播的示例代码

1、安装swiper

rush:xhtml;"> npm install swiper@3.4.1 --save-dev

2、引用组件

rush:xhtml;"> import Swiper from 'swiper'; import 'swiper/dist/css/swiper.min.css';

3、html页面代码

rush:xhtml;">

4、初始化组件,并设置参数

rush:xhtml;"> setTimeout(function () { state.swiperObj = new Swiper('#swiper',{ loop: true,pagination: '.swiper-pagination',autoplay: 2000,paginationClickable: true }); },100)

5、搞定,ok

以上这篇vue2.0使用swiper组件实现轮播的示例代码就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持编程之家。

相关文章

可以通过min-width属性来设置el-table-column的最小宽度。以...
yarn dev,当文件变动后,会自动重启。 yanr start不会自动重...
ref 用于创建一个对值的响应式引用。这个值可以是原始值(如...
通过修改 getWK005 函数来实现这一点。这里的 query 参数就是...
<el-form-item label="入库类型" ...
API 变动 样式类名变化: 一些组件的样式类名有所变动,可能需...