我一直在尝试在我的Web应用程序开发中采用材料手风琴。
然而,我遇到了一些问题,无法让标题随着内容增长而扩展。
我的标题预计将有相当多的行来概述,而不仅仅是一行。
如果我硬编码材质标题高度,会导致动画失控。
以下是示例代码
<mat-accordion [displayMode]="displayMode" [multi]="multi" class="mat-expansion-demo-width">
<mat-expansion-panel #panel1 [hideToggle]="hideToggle">
<mat-expansion-panel-header>Section 1</mat-expansion-panel-header>
<p>This is the content text that makes sense here.</p>
</mat-expansion-panel>
</mat-accordion>
::ng-deep .mat-expansion-panel-header
{
height: 190px !important;
}
如果我按照上述方法设置高度,展开和折叠的动画会变得不正常。
我该怎么做?
mat-panel-title
或mat-panel-description
元素中添加多行文本,则它们会重叠在一起,我无法弄清如何在mat-expansion-panel-header
中添加实际出现在第一行下方的其他内容。 - somada141