mat-tab过渡会触发具有可扩展行的角度材质表中的其他动画

问题描述

我有一个带有mat-tab-group的屏幕,一个选项卡包含一个带有可扩展行的表,这些行仅在单击时才会被扩展,但是这里的问题是,如果我们更改选项卡,它将自动扩展所有行,回来 。怎么了?

enter image description here

这将在第一次正确显示 然后

enter image description here

它将展开所有行

enter image description here

链接:StackBlitz sample

解决方法

好的,这是因为,我必须将mat-tab内容包裹起来

<ng-template matTabContent> //your content goes here </ng-template>

这是一个可行的解决方案:https://stackblitz.com/edit/angular-yeveze?file=src/app/table-expandable-rows-example.html

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...