[英]Angular material stepper next step showing create instead of 1
您可以在mat-step
上設置[completed]="false"
並且您將只有數字而不是圖標。
或者用鋼筆圖標替換"create"
這個詞,你需要添加谷歌材料字體圖標鏈接:
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"rel="stylesheet">
在 mat-horizontal-stepper 中添加#stepper
<mat-horizontal-stepper [linear]="true" #stepper>
....
</mat-horizontal-stepper>
然后在 .ts 文件中獲取那個步進器
@ViewChild('stepper') stepper: MatHorizontalStepper;
最后,在 afterViewInit 中執行
ngAfterViewInit() {
this.stepper._getIndicatorType = () => 'number';
}
可能你使用另一個字體系列而不是默認值。 您可以通過修復使用步進器的頁面中字體系列的“材料圖標”來解決此問題。
:host /deep/ .material-icons {
font-family: 'Material Icons' !important;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.