我想使用角材料库,并建立自己的图书馆与一些定制的设计。但在分割材料组分的同时也面临着一些问题。我觉得问题是影子多姆。这是我想要实现的代码。
代码
自定义选项卡-group.html -parent
<div class="custom-tabs">
<mat-tab-group disableRipple>
<ng-content></ng-content>
</mat-tab-group>
</div>自定义-tpos.html -child
<custom-tabs-group [tabContent]="tabContent">
<mat-tab *ngFor="let tab of tabContent" label="{{tab.title}}">{{tab.content}} </mat-tab>
</custom-tabs-group>有可能吗?请让我知道
发布于 2019-05-10 07:55:34
你共享的代码反向使用了ng内容.<custom-tabs-group>将位于父级,<ng-content>将位于子级别。
我尝试了两种方法:
<mat-tab>中的自定义子程序.这起作用了<mat-tab>位于子层中.这不管用你可以检查这里的演示
https://stackoverflow.com/questions/56069092
复制相似问题