From e80925e443acedd2c65eb972567ba393aeef05ce Mon Sep 17 00:00:00 2001 From: Vladimir Kharlampidi Date: Tue, 7 Sep 2021 11:07:44 +0300 Subject: [PATCH] fix(virtual): fix Virtual slides in React, Vue & Angular fixes #4899 --- src/angular/src/swiper.component.ts | 1 + src/react/swiper.js | 1 + src/vue/swiper.js | 1 + 3 files changed, 3 insertions(+) diff --git a/src/angular/src/swiper.component.ts b/src/angular/src/swiper.component.ts index dfe182313..801cfc927 100644 --- a/src/angular/src/swiper.component.ts +++ b/src/angular/src/swiper.component.ts @@ -568,6 +568,7 @@ export class SwiperComponent implements OnInit { swiperRef.virtual.slides = this.slides; const extendWith = { cache: false, + slides: this.slides, renderExternal: this.updateVirtualSlides, renderExternalUpdate: false, }; diff --git a/src/react/swiper.js b/src/react/swiper.js index 96574f2f1..c23bf482a 100644 --- a/src/react/swiper.js +++ b/src/react/swiper.js @@ -70,6 +70,7 @@ const Swiper = forwardRef( swiperRef.current.virtual.slides = slides; const extendWith = { cache: false, + slides, renderExternal: setVirtualData, renderExternalUpdate: false, }; diff --git a/src/vue/swiper.js b/src/vue/swiper.js index 04c03f850..ddd27d2b2 100644 --- a/src/vue/swiper.js +++ b/src/vue/swiper.js @@ -272,6 +272,7 @@ const Swiper = { swiperRef.value.virtual.slides = slidesRef.value; const extendWith = { cache: false, + slides: slidesRef.value, renderExternal: (data) => { virtualData.value = data; },