作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 mat-table,显示正在执行的作业列表。目前我在所有行前面都有停止和重新执行按钮。现在我只想在第一行显示按钮。我该怎么做?
我的垫表中的按钮代码
<ng-container matColumnDef="actions">
<mat-header-cell *matHeaderCellDef> </mat-header-cell>
<mat-cell *matCellDef="let element; let index = index">
<button
mat-icon-button
(click)="stop_exec_job(element)"
matTooltip="Stop Executing the Job"
[disabled]="element.status == 'Completed' || element.status == 'FINISH'"
>
<!-- Edit icon for row -->
<i class="material-icons" style="color:red"> stop </i>
</button>
<!-- Delete icon for row -->
<button
mat-icon-button
(click)="re_run_job(element)"
matTooltip="Re-Run the Job"
[disabled]="
element.status == 'RUNNING' ||
element.status == 'Pending'
"
>
<i class="material-icons" style="color:green">
cached
</i>
</button>
</mat-cell>
</ng-container>
最佳答案
<button *ngIf="index === 0"
...>...</button>
关于javascript - 如何仅显示 mat-table 中第一行的按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54478174/
我是一名优秀的程序员,十分优秀!