diff --git a/src/components/reviews/reviews-content.pug b/src/components/reviews/reviews-content.pug index b54b41f..9489908 100644 --- a/src/components/reviews/reviews-content.pug +++ b/src/components/reviews/reviews-content.pug @@ -20,6 +20,7 @@ script(type="text/x-template" id="reviews-content") ref="carousel" :pagination-enabled="false" :per-page-custom="[[320, 1], [577, 2]]" + @page-change="updateBtns" ).revies-slider__list slide( v-for="review in reviews" diff --git a/src/scripts/reviews.js b/src/scripts/reviews.js index 6ce2dfe..145b8cc 100644 --- a/src/scripts/reviews.js +++ b/src/scripts/reviews.js @@ -72,9 +72,7 @@ new Vue({ } else { this.$refs.carousel.goToPage(this.$refs.carousel.getPreviousPage()); } - - this.nextBtnDisable = !this.$refs.carousel.canAdvanceForward - this.prevBtnDisable = !this.$refs.carousel.canAdvanceBackward + this.updateBtns() }, makeArrWithRequireImages(array) { @@ -83,6 +81,11 @@ new Vue({ item.photo = requirePic; return item; }); + }, + + updateBtns () { + this.nextBtnDisable = !this.$refs.carousel.canAdvanceForward + this.prevBtnDisable = !this.$refs.carousel.canAdvanceBackward } }