vue 注册全局swiper_Vue使用vue-awesome-swiper构建首页轮播

npm install vue-awesome-swiper@2.6.7 --save

全局引人

import Vue from 'vue'

import VueAwesomeSwiper from 'vue-awesome-swiper'

import 'swiper/dist/css/swiper.css'

Vue.use(VueAwesomeSwiper, /* { default global options } */)

创建Swiper组件

export default {

name: 'HomeSwiper',

data() {

return {

swiperOption:{

pagination: '.swiper-pagination', //配置小圆点

loop: true //无线轮播

},

swiperList: [{

id: '0001',

imgUrl: ""

},{

id: '0002',

imgUrl: ""

},{

id: '0003',

imgUrl: ""

}]

}

}

}

.wrapper >>> .swiper-pagination-bullet-active //css属性穿透

background: #fff

.wrapper

width: 100%

height: 0

overflow: hidden

padding-bottom: 27.25% //固定图片容器的长宽比

background: #eee

.swiper-img

width :100%

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值