You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Angular Material 15中mat-icon-button与mat-raised-button组合显示异常

Angular Material v15 图标按钮样式问题

版本显示对比

  • Angular v14 + Angular Material v14:按钮显示正常
  • 升级至Angular v15 + Angular Material v15后:按钮显示异常

按钮代码

<button *ngIf="admin"
        class="edit-btn"
        mat-raised-button
        mat-icon-button
        color="primary"
        [routerLink]="['edit/item', item.id]"
><mat-icon>edit</mat-icon></button>

提示信息

WebStorm提示:More than one component is matched on this element: MatButton ( button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ) and MatIconButton (button[mat-icon-button]),但Angular CLI未给出任何提示。

尝试调整后的效果

仅保留mat-icon-button属性(移除mat-raised-button)后:按钮显示不符合预期,该效果并不理想。

疑问

在Angular Material v15中,是否只能通过自定义样式解决此问题?

内容的提问来源于stack exchange,提问作者Emil

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.10 04:25:41