[英]Issue when mat-sidenav-container and mat-sidenav in different components
I have separated out mat-sidenav-container and mat-sidenav into two different components. 我将mat-sidenav-container和mat-sidenav分为两个不同的组件。 When I have my sidenav in two components like this, the mode "side" is not working anymore.
当我将sidenav包含在两个这样的组件中时,模式“ side”不再起作用。 The mode switch to "over".
模式切换到“结束”。 When I have all in the same component, it's working.
当我所有组件都在同一个组件中时,它就起作用了。
<app-layout>
<app-sidenav></app-sidenav>
<router-outlet></router-outlet>
</app-layout>
app-layout contains mat-sidenav-container component and app-sidenav contains mat-sidenav component app-layout包含mat-sidenav-container组件, app-sidenav包含mat-sidenav组件
During runtime, 在运行期间,
<app-sidenav></app-sidenav>
<router-outlet></router-outlet>
gets wrapped by mat-sidenav-content. 被mat-sidenav-content包裹。
Wrapping <mat-drawer>
or <mat-sidenav>
in a custom component is not currently supported and won't work. 目前不支持在自定义组件中包装
<mat-drawer>
或<mat-sidenav>
,并且将无法使用。 See https://stackoverflow.com/a/48308330/9226213 . 参见https://stackoverflow.com/a/48308330/9226213
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.