How to bind a property to style.width in pixels?

前端 未结 4 1706
时光取名叫无心
时光取名叫无心 2021-02-05 00:10

I\'m using Angular 2 and I\'ve written the below code:

some texts

I\'ve also tried:

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-05 00:51

    For pixel unit

    Width Size with px

    Or

    Width Size with px

    Other CSS units

    Width Size with em
    Width Size with pt
    Width Size with %

    Component

    export class MyComponent
    {
       width: number = 80;
    }
    

提交回复
热议问题