【问题标题】:How to display the group of dynamic buttons (columns as buttons) using mat-table in angular 8如何在角度 8 中使用 mat-table 显示动态按钮组(列作为按钮)
【发布时间】:2020-02-06 15:22:24
【问题描述】:

我有一个动态按钮的要求,需要使用 angular8 在页面中显示。

并且会根据下拉选择按钮动态变化。

【问题讨论】:

    标签: angular angular-material angular8


    【解决方案1】:

    您可以在 ng-container matColumnDef 中添加按钮, 例如

          <ng-container matColumnDef="actions">
            <th mat-header-cell *matHeaderCellDef mat-sort-header>ACTIONS </th>
              <td mat-cell *matCellDef="let object">
               <button *ngif="object.condition" (click)="openDrop()"> Trigger drop</button>
               <button>Other botton</button>
             </td>
          </ng-container>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-02-11
      • 2020-12-07
      • 2018-11-13
      • 2019-06-16
      • 2021-04-29
      • 1970-01-01
      • 1970-01-01
      • 2020-05-24
      相关资源
      最近更新 更多