Mat手风琴不适用于组件选择器

时间:2019-10-14 14:46:11

标签: angular angular-material

如何将mat手风琴绑定到不同的组件上

    <div class="dataDiv">
      <mat-accordion>
          <app-waiting-for-approval></app-waiting-for-approval>
          <app-cancel></app-cancel>
          <app-published></app-published>
          <app-system-error></app-system-error>
          <app-test-in-progress></app-test-in-progress>
      </mat-accordion>

    </div>

1 个答案:

答案 0 :(得分:1)

<div class="dataDiv">
  <mat-accordion>
   <mat-expansion-panel>
    <mat-expansion-panel-header>
      title coming here
    </mat-expansion-panel-header>
      <app-waiting-for-approval></app-waiting-for-approval>
   </mat-expansion-panel>
   <mat-expansion-panel>
    <mat-expansion-panel-header>
       second title coming here
    </mat-expansion-panel-header>
      <app-cancel></app-cancel>
   </mat-expansion-panel>
   <mat-expansion-panel>
    <mat-expansion-panel-header>
       second title coming here
    </mat-expansion-panel-header>
       <app-published></app-published>
   </mat-expansion-panel>
   <mat-expansion-panel>
    <mat-expansion-panel-header>
       second title coming here
    </mat-expansion-panel-header>
       <app-system-error></app-system-error>
   </mat-expansion-panel>
   <mat-expansion-panel>
    <mat-expansion-panel-header>
       second title coming here
    </mat-expansion-panel-header>
       <app-test-in-progress></app-test-in-progress>
   </mat-expansion-panel>
</mat-accordion>
</div>

你可以试试吗?

示例链接:link