1.0.4 • Published 5 years ago

vue-h5-swiper v1.0.4

Weekly downloads
39
License
MIT
Repository
github
Last release
5 years ago

Features

  • Slight, only has better-scroll dependency.
  • Support long content page.
  • A great diversity of paging animations.
  • Without fake element at loop mode.
  • Optimized displayed SwiperItem count.

Demos

Online demo: https://edgarallanzp.github.io/vue-h5-swiper/

Or

yarn dev

Installation

npm install vue-h5-swiper --save

# or use yarn
yarn add vue-h5-swiper
<template>
  <swiper>
    <swiper-item>
      ...
      Content Slot
      ...
    </swiper-item>
  </swiper>
</template>

<script>
import { Swiper, SwiperItem } from 'vue-h5-swiper';

export default {
  components: {
    Swiper,
    SwiperItem
  }
};
</script>

Documentation

Swiper

Props

PropDefaultDescription
loopfalseEnable loop mode.
show-indicatortrueDisplay indicators.
page-transition'move'Paging animation. Available animations: ['move', 'fade', 'cover', 'carousel', 'scale', 'glue', 'cube', 'push', 'three']
autoplayfalseAuto slide.
interval3000Auto slide interval.

Events

EventParamsDescription
beforeChangeactiveIndex, oldIndexBefore paging hook.
afterChangeactiveIndex, oldIndexAfter paging hook.

Methods

MethodDescription
moveTo(index)Move to the specified page.
next()Move to next page.
prev()Move to previous page.

Slots

SlotDescription
default---------For SwiperItem.
indicator-------Custom swiper indicator.

SwiperItem

Slots

SlotDescription
default---------For display content.

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

License

MIT

Copyright (c) 2019, Edgar Li