我想通过应用 justify-content-end
和 text-right
选择性地右对齐某些列,当它们匹配每条记录的某些条件时,渲染的版本看起来像这样:
<ion-content padding>
<ion-grid>
<ion-row>
<ion-col col-8>Stuff</ion-col>
</ion-row>
<ion-row justify-content-end text-right>
<ion-col col-8>Stuff 2</ion-col>
</ion-row>
<ion-row>
<ion-col col-8>Stuff 3</ion-col>
</ion-row>
<ion-row justify-content-end text-right>
<ion-col col-8>Stuff 4</ion-col>
</ion-row>
</ion-grid>
</ion-content>
我怎么能把它放在代码中?我需要以某种方式使用 *ngIf
吗?
2 回答
不需要
*ngIf
,您只需要ngClass
:代替
true / false
使用你的conditions
欲了解更多详情,请阅读: NgClass
对于动态属性使用,
你可以使用这样的东西
什么时候: