0.1.2 • Published 3 years ago

vue-crsl v0.1.2

Weekly downloads
99
License
MIT
Repository
gitlab
Last release
3 years ago

vue-crsl

Try it out here: Vue Carousel

🚀 Usage

npm i vue-crsl

Vue

import Carousel from 'vue-crsl'
export default {
  components: {
    Carousel
  }
}

Nuxt

// Create a plugin - ~/plugins/vue-crsl.js
import Vue from 'vue'
import Carousel from 'vue-crsl'

Vue.component('Carousel', Carousel)

// nuxt.config.js
plugins: [
  {src: '~/plugins/crsl.js', ssr: false}
]

Slot

Custom arrows

<Carousel ref="carousel">
  <img src="...">
  <img src="...">
  <img src="...">
  <template v-slot:arrows>
    <button @click="$refs.carousel.prev()" :disabled="$refs.carousel.arrowsDisabled || $refs.carousel.isArrowDisabled.prev">Prev</button>
    <button @click="$refs.carousel.next()" :disabled="$refs.carousel.arrowsDisabled || $refs.carousel.isArrowDisabled.next">Next</button>
  </template>
</Carousel>

Custom dots

<Carousel ref="carousel">
  <img src="...">
  <img src="...">
  <img src="...">
  <template v-slot:dots="{activeIndex, items}">
    {{ activeIndex }}
  </template>
</Carousel>

Props

propertydefault
dotstrue
arrowstrue
infinitetrue
transitionDuration500
adaptiveHeightfalse
autoplay3000
autoplayDirectionforward
pauseOnHovertrue
lazyLoadfalse
loadingBartrue
loadingBarPercentagetrue
fadefalse
dragOffset50

Events

eventreturn
initinstance
changeindex, activeElement
before-changeoldIndex, index, activeElement
after-changeindex, oldIndex, activeElement
navigation-clickedindex, oldIndex, activeElement
arrow-clickedindex, oldIndex, direction
dot-clickedindex, oldIndex, activeElement
draginstance
dragstartinstance
dragendinstance

Methods

methodparameters
goToSlideindex
appendDOM element
prependDOM element
next-
prev-
0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.5

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

0.0.0

4 years ago