0

在我的项目中,我正在使用<mat-expansion-panel>. 我正在尝试将2 title elementusing<mat-panel-title>与他们并排添加respective description

目前我的代码显示

Title1 Title2 Description1 Description2

我正在寻找的是

Title1 Description1 Title2 Description2

这是我的代码 - 链接 - https://stackblitz.com/edit/mat-expansion-panel-q1qxz7?file=app%2Fexpansion-overview-example.html

<mat-nav-list>
  <mat-expansion-panel>
    <mat-expansion-panel-header>
      <mat-panel-title>
        Title 1 </mat-panel-title>
      <mat-panel-description>
        <dd class="col-sm-10 record_property_value" data-property-type="select">{{ 'Description fror Title 1'}}</dd>
      </mat-panel-description>
      <mat-panel-title>
        Title 2
      </mat-panel-title>
      <mat-panel-description>
        <dd class="col-sm-10 record_property_value" data-property-type="select">{{ 'Description fror Title 2'}}</dd>
      </mat-panel-description>
    </mat-expansion-panel-header>
  </mat-expansion-panel>
</mat-nav-list>
4

1 回答 1

1

根据 Angular 材料文档,mat-expansion-panel-header应该有一个<mat-panel-title>和一个<mat-panel-description>,用于正确定位面板内容。但是在您的情况下,您可以尝试这种方法...

我在这里编辑了你的stackblitz,它似乎正在工作。请验证..

于 2021-05-13T15:47:23.480 回答