我已经进行了一些api调用后试图初始化我的swiper容器。但是,当我这样做时,我得到错误类型'元素'上不存在'刷卡器'。这是Swiper API的链接:Swiperjs
ngOnInit() {
this.spinner.show().then( async () => {
this.data.currentProgress.subscribe(progress => this.progress = progress);
await this.eventService.fetchEvents();
}).then(async () => {
const mySwiper = document.querySelector('.swiper-container').swiper;
mySwiper.init();
}).then(() => {
this.spinner.hide();
});
}
代替