【发布时间】:2020-08-04 22:20:26
【问题描述】:
这是我的 css 代码
.mat-step-header[aria-selected="true"] {
background-color: #07C496;
}
.mat-step-header[ng-reflect-active='true']{
background-color: #07C496;
}
html:
<mat-horizontal-stepper #stepper labelPosition="bottom" linear >
<ng-template matStepperIcon="edit" let-index="index"> {{index + 1}}
</ng-template>
<mat-step>
<ng-template matStepLabel>test</ng-template>
<div>
</mat-step>
<mat-step>
<ng-template matStepLabel>test</ng-template>
<div>
</mat-step>
<mat-step>
<ng-template matStepLabel>test</ng-template>
<div>
</mat-step>
<mat-step>
<ng-template matStepLabel>test</ng-template>
<div>
</mat-step>
</mat-horizontal-stepper>
这个东西只在开发模式下工作,但在 prod 模式下不起作用,因为 ng-reflect-active 在 prod 模式下不存在。谁能帮我在css中做到这一点。
【问题讨论】:
-
你可以试试
ng-deepblog.angular-university.io/angular-host-context -
如何确定进度?我们需要看到更多(至少是关于 html 的内容)才能知道什么是可能的。
-
@enno.void 它不会工作,因为 ng-reflect-active 在 prod 模式下不存在
标签: css angular typescript