Skip to content

Commit acbcbca

Browse files
committed
Fixed carousel issues bootstrap-vue#17
1 parent 1d86bf1 commit acbcbca

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

components/carousel.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@
119119
},
120120
// start auto rotate slides
121121
start() {
122-
if (this.interval === 0 || typeof this.interval === 'undefined') return;
123-
this._intervalId = setInterval(function () {
124-
this.next()
125-
}, this.interval);
122+
if (this.interval === 0 || typeof this.interval === 'undefined') return;
123+
this._intervalId = setInterval( () => {
124+
this.next()
125+
}, this.interval);
126126
}
127127
},
128128
mounted() {
@@ -158,12 +158,12 @@
158158
this._items[oldVal].classList.add(this.direction.outgoing);
159159
this._items[val].classList.remove(this.direction.incoming);
160160
// wait for animation to finish and cleanup classes
161-
this._carouselAnimation = setTimeout(function () {
162-
this._items[oldVal].classList.remove(this.direction.outgoing, 'active');
163-
this._items[val].classList.remove(this.direction.overlay);
164-
this.animating = false;
165-
// trigger an event
166-
$root.$emit('slid::carousel', val)
161+
this._carouselAnimation = setTimeout( () => {
162+
this._items[oldVal].classList.remove(this.direction.outgoing, 'active');
163+
this._items[val].classList.remove(this.direction.overlay);
164+
this.animating = false;
165+
// trigger an event
166+
this.$root.$emit('slid::carousel', val)
167167
}, TRANSITION_DURATION);
168168
}
169169
},

components/components.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import bButtonRadio from './button-radio'
66
import bButton from './button'
77
import bCard from './card'
88
import bCarousel from './carousel'
9-
import bCarouselSlide from './carousel'
9+
import bCarouselSlide from './carousel-slide'
1010
import bCollapse from './collapse'
1111
import bCollapseToggle from './collapse-toggle'
1212
import bDropdown from './dropdown'
@@ -67,7 +67,7 @@ export {
6767
bNavItemDropdown,
6868
bListGroupItem,
6969
bListGroup,
70-
bCarouselSlide,
70+
bCarouselSlide as bSlide,
7171
bCarousel,
7272
bCollapse,
7373
bCollapseToggle

0 commit comments

Comments
 (0)