Skip to content

Commit

Permalink
feat: added Array type to navigateTo prop type check (#366)
Browse files Browse the repository at this point in the history
Updated readme.md; Added example usage to Vue play file
  • Loading branch information
rico-ocepek authored and quinnlangille committed Mar 21, 2019
1 parent 649b9b2 commit bcaee5a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions play/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ play("Carousel", module)
`<div style="width: 100%; display: flex; justify-content: center; margin-top: 40px;">
<carousel style="width: 500px;" :navigateTo="navigateTo" :scrollPerPage=false v-on:pagechange="pageChanged">
<carousel style="width: 500px;" :navigateTo="newSlide" :scrollPerPage=false v-on:pagechange="pageChanged">
<carousel style="width: 500px;" :navigateTo="navigateTo" :scrollPerPage=false v-on:pagechange="pageChanged">
<slide v-for="slide in slides" :key="slide.src">
<img style="width: 100%;" :src= slide />
</slide>
Expand All @@ -404,6 +405,15 @@ play("Carousel", module)
slides: images
}
},
computed: {
navigateTo() {
if (this.newSlideAnimation)
return this.newSlide

else
return [this.newSlide, false]
}
},
methods: {
gotoSlide(val, animation) {
this.newSlideAnimation = (animation === false ? false : true);
Expand Down

0 comments on commit bcaee5a

Please sign in to comment.