ion-item-options不显示 [英] ion-item-options not displaying
问题描述
我正在使用Ionic 3开发应用程序.我在离子列表中包裹了一个可滑动离子项目的窗口.刷列表项时,我需要显示选项.我得到了有效的颜色,但是文本根本没有显示.我根本没有将CSS应用于按钮.
I am developing an app using Ionic 3. I have an ion-item-sliding wrapped within an ion-list. I need to show the options when the list item is swiped. I got the color working but the text is not displaying at all. I don't have any css applied to the button at all.
<ion-list text-wrap>
<ion-list-header>
...
</ion-list-header>
<ion-item *ngIf="classes?.length === 0">No Data</ion-item>
<ion-item-group *ngFor="let classObj of classes">
<ion-item-divider>...</ion-item-divider>
<ion-item-sliding *ngFor="let class of classObj?.classes">
<ion-item *ngFor="let class of classObj?.classes">
<ion-grid>
...
</ion-grid>
</ion-item>
<ion-item-options side="right">
<button ion-button color="secondary">
Change
</button>
</ion-item-options>
</ion-item-sliding>
</ion-item-group>
</ion-list>
我不知道出了什么问题.Android和iOS都发生了这种情况
I have no idea what went wrong. This happened to both Android and iOS
推荐答案
好的,我已经找到了解决方案.我误将 * ngFor
和 ion-item
和 ion-item
都弄错了,因此滑块损坏了.我在 ion-item
中删除了 * ngFor
,现在一切正常
Its ok I have found the solution. I mistakenly *ngFor
both ion-item-sliding
and ion-item
hence the slider breaks. I removed *ngFor
in the ion-item
and everything is works fine now
这篇关于ion-item-options不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!