首页 文章

Parent mat-grid-list中的新mat-grid-list无效

提问于
浏览
1

我想把mat-grid-list放在 PARENT mat-grid-list里面 .

以下是代码 -

<mat-grid-list cols="12" rowHeight="2:1" gutterSize=2px>

<mat-grid-tile colspan="12" rowspan="1"  [style.background-color]="'brown'">
 LOGO
</mat-grid-tile>
<mat-grid-tile colspan="1" rowspan="16"  [style.background-color]="'brown'">
 Navigation
</mat-grid-tile>
<mat-grid-tile colspan="8" rowspan="16">
**<app-child-content></app-child-content>** New Component includes mat-grid
</mat-grid-tile>
<mat-grid-tile colspan="3" rowspan="16"  [style.background-color]="'brown'">
 Trending
</mat-grid-tile>

</mat-grid-list>

App Child Component's Content -

<mat-grid-list cols="1" rowHeight="1" gutterSize=2px>

<mat-grid-tile colspan="1" rowspan="1"  [style.background-color]="'brown'">
  Child Grid list Not Working
</mat-grid-tile>
</mat-grid-list

1 回答

  • 0

    解决了它,但仍然需要学习 - 为子组件提供100%高度和100%宽度属性 .

    <app-child-content class="child-css"></app-child-content>
    .child-css{
     width: 100%;
     height: 100%;
     }
    

相关问题