【发布时间】:2019-03-31 16:30:53
【问题描述】:
我正在尝试自定义step-numbers,例如1、2、3,在步进器的initial state 中为每个步骤显示不同的图标
我目前可以通过在ng-template 状态下使用matStepperIcon 值edit 来替换step-numbers,如下所示
有了这个,我看到只有当我们进入下一步时,前面的步骤 step-number 才会更改为 icon (donut_large)。
<mat-vertical-stepper [linear]="isLinear" #stepper>
<ng-template matStepperIcon="edit"><mat-icon>donut_large</mat-icon> </ng-template>
<mat-step >
...为简洁起见排除代码 ...
1) 我是否需要将 donut_large 图标与其他 matStepperIcon 值一起使用,而不是 edit 。所以看到 donut_large 图标也显示在 Steppers reset 状态的台阶上。
2) 可以使用所有其他StepState 值,因为当我尝试使用done 或reset 等任何其他值时,matStepperIcon 不起作用。它仅在我将值用作 edit 时才有效。根据角度材料网站matStepperIcon 上的文档,指的是
@Input('matStepperIcon') |
name: StepState | Name of the icon to be overridden.
【问题讨论】:
-
你能把stackblitz.com的例子放在一起吗?
标签: angular angular-material angular-material2