欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

mat-button-toggle 改变大小 宽度 高度 行高 样式 有大用

1) 给 mat-button-toggle-group 增加  appearance="legacy"

<div>
            <mat-button-toggle-group appearance="legacy" formControlName="ageUnit">
            <!-- <mat-button-toggle-group formControlName="ageUnit"> -->
                <mat-button-toggle *ngFor="let unit of ageUnits" [value]="unit.vale">
                    {{unit.label}}
                </mat-button-toggle>
            </mat-button-toggle-group>
        </div>


2) 增加如下的css

 mat-button-toggle {
    height30px;
    line-height30px;
  }




普通分类: