代码之家  ›  专栏  ›  技术社区  ›  RV.

拆下物料步进收割台

  •  5
  • RV.  · 技术社区  · 6 年前

    我想去掉材料步进器上的标题导航。请建议我怎么做? 我尝试设置以下css,但似乎没有成功:

    .mat-horizontal-stepper-header-container{display: none}
    

    这是步进器的stackblitz链接。 https://stackblitz.com/edit/angular-material2-beta-ybbnhe?file=app%2Fapp.component.html

    enter image description here

    2 回复  |  直到 6 年前
        1
  •  21
  •   Simon K    6 年前

    你需要结合使用 ::ng-deep 为了避开影子多姆和 !important 标记以绕过材质自身样式:

    ::ng-deep .mat-horizontal-stepper-header-container {
      display: none !important;
    }
    
        2
  •  2
  •   Md Rafee    5 年前

    @西蒙K的回答是正确的。但它会影响你应用程序中的所有步进器。但是如果你想把它用于你的特定组件,使用 :host ::ng-deep . 那么它不会影响应用程序中的其他步进器(如果有的话)。例如@Simon K'答案-

    :host ::ng-deep .mat-horizontal-stepper-header-container {
      display: none !important;
    }
    
        3
  •  -6
  •   dev-assassin    6 年前

    您可以将此css属性添加到 <mat-horizontal-stepper #stepper> 这样地:

    <mat-horizontal-stepper #stepper style="display: none;">
    ....
    </mat-horizontal-stepper>