diff --git a/components/carousel.vue b/components/carousel.vue index dacd0c2e54d..8dd265ee330 100755 --- a/components/carousel.vue +++ b/components/carousel.vue @@ -119,10 +119,10 @@ }, // start auto rotate slides start() { - if (this.interval === 0 || typeof this.interval === 'undefined') return; - this._intervalId = setInterval(function () { - this.next() - }, this.interval); + if (this.interval === 0 || typeof this.interval === 'undefined') return; + this._intervalId = setInterval( () => { + this.next() + }, this.interval); } }, mounted() { @@ -158,12 +158,12 @@ this._items[oldVal].classList.add(this.direction.outgoing); this._items[val].classList.remove(this.direction.incoming); // wait for animation to finish and cleanup classes - this._carouselAnimation = setTimeout(function () { - this._items[oldVal].classList.remove(this.direction.outgoing, 'active'); - this._items[val].classList.remove(this.direction.overlay); - this.animating = false; - // trigger an event - $root.$emit('slid::carousel', val) + this._carouselAnimation = setTimeout( () => { + this._items[oldVal].classList.remove(this.direction.outgoing, 'active'); + this._items[val].classList.remove(this.direction.overlay); + this.animating = false; + // trigger an event + this.$root.$emit('slid::carousel', val) }, TRANSITION_DURATION); } }, diff --git a/components/components.js b/components/components.js index d335c2673ec..2fd6fa6a781 100755 --- a/components/components.js +++ b/components/components.js @@ -6,7 +6,7 @@ import bButtonRadio from './button-radio' import bButton from './button' import bCard from './card' import bCarousel from './carousel' -import bCarouselSlide from './carousel' +import bCarouselSlide from './carousel-slide' import bCollapse from './collapse' import bCollapseToggle from './collapse-toggle' import bDropdown from './dropdown' @@ -67,7 +67,7 @@ export { bNavItemDropdown, bListGroupItem, bListGroup, - bCarouselSlide, + bCarouselSlide as bSlide, bCarousel, bCollapse, bCollapseToggle