props:{
recommend:Array, // 轮播数组
},
watch:{
recommend(){
// 解决swiper 4显示不出分页器问题
if(this.recommend.length){
this.$nextTick(() => {
new Swiper('.swiper-container',{
loop: true, // 循环模式选项
autoplay: true,// 自动滑动
pagination: {
el: '.swiper-pagination',
},
})
})
}
}
}