Mat*_*tte 7 angular-material angular angular-material-stepper
如何从 Angular 材料步进器中删除数字?
我不想用图标替换它们,我希望有一个空圆圈。
编辑:我正在使用 Angular 9
小智 5
在 mat-step 内,插入这些模板,从而替换默认的数字。
<mat-horizontal-stepper [linear]="true" #stepper>
<!-- STEPS -->
<mat-step label="First Step" state="your-state-name-here-1">
<div>
<button mat-button matStepperNext>next</button>
</div>
</mat-step>
<mat-step label="Second Step" state="your-state-name-here-2">
<div>
<button mat-button matStepperNext>next</button>
</div>
</mat-step>
<mat-step label="Third Step" state="your-state-name-here-3">
<div>
<button mat-button matStepperNext>next</button>
</div>
</mat-step>
<!-- STEPS -->
<!-- Replace icon mat-step -->
<ng-template matStepperIcon="your-state-name-here-1">
<mat-icon>your-icon-name-or-blank</mat-icon>
</ng-template>
<ng-template matStepperIcon="your-state-name-here-2">
<mat-icon>your-icon-name-or-blank</mat-icon>
</ng-template>
<ng-template matStepperIcon="your-state-name-here-3">
<mat-icon>your-icon-name-or-blank</mat-icon>
</ng-template>
<!-- Replace icon mat-step -->
</mat-horizontal-stepper>
Run Code Online (Sandbox Code Playgroud)
Obs: 为了使用自定义步骤状态,您必须将 displayDefaultIndicatorType 选项添加到全局默认步进器选项中,该选项可以通过在应用程序的根模块或特定子模块中为 STEPPER_GLOBAL_OPTIONS 提供值来指定。
@NgModule({
providers: [
{
provide: STEPPER_GLOBAL_OPTIONS,
useValue: { displayDefaultIndicatorType: false }
}
]
})
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7820 次 |
| 最近记录: |