【发布时间】:2023-03-06 11:11:01
【问题描述】:
据此link
我可以的
<p [style.width.px]="30">
Some text that may be important.
</p>
这将设置宽度为 30 像素。 我如何为百分比做同样的事情?
<p [style.width.percent]="30"> // This doesn't work
Some text that may be important.
</p>
【问题讨论】:
-
@HereticMonkey 你知道 AngularJS 和 Angular 是天壤之别吧?
-
是的,我猜我被同样的答案抛出了......这是 Angular 的骗局:Angular2 Bind Attribute Value 或 Resizing height & width of the div in percentage not pixel by using angular 5
-
@HereticMonkey 没错,你之前给我发错了链接
标签: angular typescript