0.1.2 • Published 6 years ago

vue-awesome-slides v0.1.2

Weekly downloads
13
License
-
Repository
-
Last release
6 years ago

vue-awesome-slides

why another slides

most slides are implement by set a visible view,make all slides in one row and use position or transform to make the slide show in the view. the problem of this method is when you in slide one and you select slide three pager, the slide two must cross the view,this is the reason why another slides. I use 'debut' concept to resolve this problem,you can find it in code.

Project setup

npm i vue-awesome-slides --save

Project use

import Slide from 'vue-awesome-slides/component/Slides.vue'

# default use
<Slides :slides="slidesData" :slidesConfig="config" />

#custom slide
<Slides :slides="slidesData" :slidesConfig="config" />
  <template slot="slide" slot-scope="props">
      # your custom slide template, you can get data from props.slide
      <div>{{props.slide.xxx}}</div>   
  </template>

#custom slide control
<Slides :slides="slidesData" :slidesConfig="config" />
  <template slot="slide-pager-item" slot-scope="props">
      # your custom slide template, you can get data from props.slide
      <div>{{props.slide.xxx}}</div>   
  </template>

demo

with vue cli 3.0 prototyping,you can start the demo quickly, just go demo directory and serve it

Props

NameTypeDesc
slidesArrayslides data
slidesConfigObjectslides config

slidesConfig

NameTypeDefalutDesc
modeStringhorizontalType of transition between slides 'horizontal' 'vertical' 'fade'
autoPlayBooleanfalseSlides will automatically transition
infiniteBooleantrueIf true, clicking "Next" while on the last slide will transition to the first slide and vice-versa
speedNumber500Slide transition duration (in ms)
loopTimeNumber5000The amount of time (in ms) between each auto transition
pagerBooleantrueIf true, a pager will be added
controlsBooleantrueIf true, a controls will be added

Methods

NameDesc
goToSlidePerforms a slide transition to the supplied slide index (zero-based)
goToNextSlidePerforms a "Next" slide transition
goToPrevSlidePerforms a "Prev" slide transition

Events

NameDesc
beforeChangewhen slide start transition emit
afterChangewhen slide end transition emit

custom

you can custom your own slide and slide pager and with vue scoped slots every slide data is back to you the slot name is slide and slide-pager-item