ngStyle调用方法加载样式

tech2022-08-01  147

语言使用 angular9 

html文件 

<div [ngStyle]="calcHeight()"></div>

ts文件

calcHeight(): {'height': string}{ return { 'height': 'calc(100% - 15px)' }; }

 

最新回复(0)