【发布时间】:2017-10-19 03:09:42
【问题描述】:
我在主页上使用了 ion-slides,但它不适用于自动播放。
离子代码:
<ion-slides autoplay=300>
<ion-slide *ngFor = "let banners of bannersImage">
<img src={{banners.image}}>
</ion-slide>
</ion-slides>
错误信息:
Uncaught TypeError: Cannot read property 'hasAttribute' of undefined
at autoplay (main.js:43827)
at startAutoplay (main.js:43870)
at initSwiper (main.js:43816)
at Slides._initSlides (main.js:55290)
at main.js:55311`enter code here`
【问题讨论】:
-
*ngFor是一个单词 -
是的 ngfor 是我们正在使用的单个单词
-
这对我有用 - 1) html:
<ion-slides [autoplay]="autoPlay"><ion-slide></ion-slide></ion-slides>2) ts:this.autoPlay = 3000告诉我。
标签: angular typescript ionic2 ionic3