用于在 mat

编程入门 行业动态 更新时间:2024-10-28 12:29:05
本文介绍了用于在 mat-vertical-stepper 中完成 mat-step 的 CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

mat-vertical-stepper 中,我有 4 个 mat-step.第一步完成后如何打勾?

In mat-vertical-stepper I have 4 mat-step. How can I have tick-mark once 1st step is completed?

我试过了:

  <mat-vertical-stepper style="background:#f2ecec;" #stepper  [linear]="true">
    <mat-step label="General Details" [stepControl]="generalDetailsForm" completed="true" editable="true">
       <h3> Name </h3>
    </mat-step>
  </mat-vertical-stepper>

如果我制作 editable="false",它会给出一个勾号,并且不能像我制作的那样进行编辑 "false".只有 completed="true" 我根本没有得到任何刻度线.

If I make editable="false", it is giving a tick mark and can't be editable as I made it "false". Having only completed="true" I am not getting any tick mark at all.

需要帮助:

如何在 mat-step 完成后打勾获取刻度线后,刻度线应为绿色(为此必须添加CSS)

推荐答案

更新 05/18(图标)

根据 docs,现在可以自定义图标,例如这个:

Update 05/18 (icons)

According to the docs, icons can now be customized like this:

<mat-vertical-stepper>
  <ng-template matStepperIcon="edit">
    <custom-icon>edit</custom-icon>
  </ng-template>

  <ng-template matStepperIcon="done">
    <custom-icon>done</custom-icon>
  </ng-template>

  <!-- Stepper steps go here -->
</mat-vertical-stepper>

原帖

在官方文档中,它说:

注意,如果completedstepControl都设置了,stepControl将优先.

Note that if both completed and stepControl are set, the stepControl will take precedence.

因此,如果您想使用completed 属性,您需要删除您的stepControl.

So, if you want to use the completed attribute you need to delete your stepControl.

如果你想改变图标,你可能需要等待这个提交 合并.另外,请查看 MatStepHeader 指令.它有一个您可以设置的 icon 输入属性;例如icon="done" 为您的刻度线.

If you want to change the icon, you might have to wait for this commit to be merged. Also, have a look at the MatStepHeader directive. It has an icon input property you can set; e.g. icon="done" for your tick mark.

似乎还没有通过 API 更改颜色的选项.作为一种解决方法,您可以使用以下方法:

There does not seem to be an option to change the color via the API, yet. As a workaround, you could use something like:

/deep/ .mat-step-header .mat-step-icon {
  background-color: red;
}

这篇关于用于在 mat-vertical-stepper 中完成 mat-step 的 CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-21 13:25:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1003454.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:mat

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!