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子组件的内容——

<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
4

1 回答 1

1

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

<app-child-content class="child-css"></app-child-content>
.child-css{
 width: 100%;
 height: 100%;
 }
于 2018-08-16T15:51:32.580 回答