我试图添加一个刷新按钮到一个材料数据表的角度7,但图标的名称,refresh显示为斜体而不是图标。
有关守则如下:
<table mat-table [dataSource]="myDataSource">
<!-- other rows... -->
<ng-container matColumnDef="buttons">
<th mat-header-cell *matHeaderCellDef>
<button (click)="reload()" mat-icon-button>
<i class="material-icons" alt="reload">refresh</i>
</button>
</th>
<td mat-cell *matCellDef="let row">
<!-- buttons for each row here -->
</td>
</ng-container>
</table>不可能向datatable的标题中添加材料图标吗?
它确实适用于普通的桌子。
发布于 2021-12-10 17:14:26
发现问题了。
应用于标头的font-family正在隐藏Material Icons字体。
将正确的字体添加到组件的样式中,以及移除斜体样式,解决了这个问题。
https://stackoverflow.com/questions/70306799
复制相似问题