Skip to content

Commit

Permalink
fix(vue): update virtual slides on nextTick
Browse files Browse the repository at this point in the history
Fixes #4172
  • Loading branch information
nolimits4web committed Feb 1, 2021
1 parent 19a645d commit 5208b1a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/vue/swiper.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { h, ref, onMounted, onUpdated, onBeforeUnmount, watch } from 'vue';
import { h, ref, onMounted, onUpdated, onBeforeUnmount, watch, nextTick } from 'vue';
import { getParams } from './get-params';
import { initSwiper, mountSwiper } from './init-swiper';
import { needsScrollbar, needsNavigation, needsPagination, uniqueClasses, extend } from './utils';
Expand Down Expand Up @@ -300,12 +300,11 @@ const Swiper = {
});

// update on virtual update
watch(
() => virtualData,
() => {
watch(virtualData, () => {
nextTick(() => {
updateOnVirtualData(swiperRef.value);
},
);
});
});

// mount swiper
onMounted(() => {
Expand Down

0 comments on commit 5208b1a

Please sign in to comment.