1.0.0 • Published 6 years ago

vue-bswiper v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

vue-bswiper

vue-bswiper是基于better-scroll的vue的轮播组件,它通过props控制是否自动轮播,是否可以循环切换,控制轮播速度、自动轮播时图片切换速度等。

npm安装

npm i vue-bswiper --save

props

参数说明类型默认值
loop是否可以循环切换图片Booleantrue
autoPlay是否自动播放Booleantrue
speed动画滚动速度Number800
interval自动切换图片的时间间隔Number2000
showDot是否显示分页器Booleantrue

例子 html应该按照下面例子的结构,其中a标签可以替换成其他标签

<template>
  <div class="banner">
    <Swiper :autoPlay="false">
      <a href="http://gh.moment16.com">
        <img src="http://d300.paixin.com/thumbs/1016676/40179869/staff_1024.jpg?imageView2/2/w/400/h/400">
      </a>
      <a href="javascript:void(0)">
        <img src="http://d007.paixin.com/thumbs/1003434/9017610/staff_1024.jpg?imageView2/2/w/400/h/400">
      </a>
    </Swiper>
  </div>
</template>
<script>
import BSwiper from 'vue-bswiper'
export default {
  components: {
    BSwiper
  }
}
</script>
<style lang="scss" scoped>
.banner{
  width:100%;
  height: 200px;
}
</style>