Skip to content

Commit

Permalink
docs: Document slick events binding
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgv committed Mar 22, 2018
1 parent c66e56e commit 4a71042
Showing 1 changed file with 49 additions and 1 deletion.
50 changes: 49 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,60 @@ new Vue({
this.$refs.slick.reSlick();
});
},

// Events listeners
handleAfterChange(event, slick, currentSlide) {
console.log('handleAfterChange', event, slick, currentSlide);
},
handleBeforeChange(event, slick, currentSlide, nextSlide) {
console.log('handleBeforeChange', event, slick, currentSlide, nextSlide);
},
handleBreakpoint(event, slick, breakpoint) {
console.log('handleBreakpoint', event, slick, breakpoint);
},
handleDestroy(event, slick) {
console.log('handleDestroy', event, slick);
},
handleEdge(event, slick, direction) {
console.log('handleEdge', event, slick, direction);
},
handleInit(event, slick) {
console.log('handleInit', event, slick);
},
handleReInit(event, slick) {
console.log('handleReInit', event, slick);
},
handleSetPosition(event, slick) {
console.log('handleSetPosition', event, slick);
},
handleSwipe(event, slick, direction) {
console.log('handleSwipe', event, slick, direction);
},
handleLazyLoaded(event, slick, image, imageSource) {
console.log('handleLazyLoaded', event, slick, image, imageSource);
},
handleLazeLoadError(event, slick, image, imageSource) {
console.log('handleLazeLoadError', event, slick, image, imageSource);
},
},
});
```

```html
<slick ref="slick" :options="slickOptions">
<slick
ref="slick"
:options="slickOptions"
@afterChange="handleAfterChange"
@beforeChange="handleBeforeChange"
@breakpoint="handleBreakpoint"
@destroy="handleDestroy"
@edge="handleEdge"
@init="handleInit"
@reInit="handleReInit"
@setPosition="handleSetPosition"
@swipe="handleSwipe"
@lazyLoaded="handleLazyLoaded"
@lazyLoadError="handleLazeLoadError">
<a href="http://placehold.it/2000x1000"><img src="http://placehold.it/2000x1000" alt=""></a>
<a href="http://placehold.it/2000x1000"><img src="http://placehold.it/2000x1000" alt=""></a>
<a href="http://placehold.it/2000x1000"><img src="http://placehold.it/2000x1000" alt=""></a>
Expand Down

0 comments on commit 4a71042

Please sign in to comment.