我在代码中添加了ion-icon,它显示了两次。 这是我的代码:
<span item-right> <ion-icon name="create" [id]='create_icon' (click)="enableClick()" ></ion-icon></span>
on-icon {
color: white !important;
margin: 2px -13px -33px 0 !important;
background-color: transparent;
border-bottom:1px solid #577995 !important;
font-size: 27px;
padding: 0px 7px 12px 0px;
}
<ion-item [id]="'item-'+data.FieldName" padding>
<ion-input
placeholder="insert your answer"
[id]="data.FieldName"
[type]="text"
name="data.FieldName"
class="search"></ion-input>
<span item-right>
<ion-icon name="create" [id]='create_icon' (click)="enableClick()" ></ion-icon></span>
</ion-item>
这是对代码的检查: the inspect in f12
我添加了隐藏样式,但没有帮助
#shadow-root.icon-inner{
display:none !important;
visibility: hidden !important;
}
:host svg{
display:none !important;
visibility: hidden !important;
}
:host(.icon-inner){
display:none !important;
visibility: hidden !important;
}
<ion-icon name="create" [id]="createIcon" md="md-create" ></ion-icon>