我想在我的组件上有条件地设置高度,这样点击它就会展开。但我想不出如何有条件地设定高度。
组件的Html:
<div class="elements-container">
<div class="section-text-container">
<ion-label class="heading-label">
{{ item.name }}
</ion-label>
<ion-label class="label">{{ item.data }}</ion-label>
<ion-label class="label" *ngIf="item.expanded === true">{{
item.status
}}</ion-label>
<ion-label class="label" *ngIf="item.expanded === true">{{
item.type
}}</ion-label>
</div>
<ion-icon
class="item-icon"
name="chevron-down-outline"
*ngIf="item.expanded === false"
></ion-icon>
<ion-icon
class="item-icon"
name="chevron-up-outline"
*ngIf="item.expanded === true"
></ion-icon>
</div>我的组件的css:
.elements-container {
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: space-between;
background: white;
margin: 0px 5vw 10px 5vw;
border-radius: 25px;
border-color: var(--ion-color-primaryBlackGradient);
border-style: solid;
border-width: 1px;
width: 80vw;
height:89px;
}如果有人知道,那么请分享你的想法。
发布于 2020-09-29 07:54:43
它可以通过以下方式进行:
然后在组件的html文件中,将其更改为:
https://stackoverflow.com/questions/64115148
复制相似问题