在进行了一些 API 调用后,我正在尝试初始化我的 Swiper 容器。但是,当我这样做时,我得到了错误:
Element 类型不存在属性“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();
});
}