假设您在某个组件的html模板中有div
<div [ngStyle]="{'grid-template-columns': repeat(5, 20%)}"></div>
如何使repeat()
Css函数在该场景中工作?
您只需要在报价中放右边:
<div [ngStyle]="{'grid-template-columns': 'repeat(5, 20%)'}"></div>