fix(slides): undefined error is no longer thrown after destroying and quickly re-creating ion-slides (#23239)

resolves #22289
This commit is contained in:
Liam DeBeasi
2021-04-26 12:25:23 -04:00
committed by GitHub
parent dab927d290
commit 2ccaabb5b4

View File

@ -39,10 +39,12 @@ export class Slides implements ComponentInterface {
async optionsChanged() { async optionsChanged() {
if (this.swiperReady) { if (this.swiperReady) {
const swiper = await this.getSwiper(); const swiper = await this.getSwiper();
if (swiper?.params) {
Object.assign(swiper.params, this.options); Object.assign(swiper.params, this.options);
await this.update(); await this.update();
} }
} }
}
/** /**
* If `true`, show the pagination. * If `true`, show the pagination.