【发布时间】:2019-08-29 10:42:38
【问题描述】:
当我点击 sort-asc 或 sort-desc 字体真棒图标时,总是会触发最后一个事件。可能出了什么问题。
自定义 css 添加到堆栈向上和向下箭头。
.custom{
margin-left: -9px;
}
<table class="table table-stripped mt-2">
<tr>
<th *ngFor="let col of colNames" >
{{col["vname"]}}
<span>
<i (click)="$event.stopPropagation();sortAsc(col)" class="fa fa-sort-asc"></i>
<i (click)="$event.stopPropagation();sortDesc(col)" class="fa fa-sort-desc custom"></i>
</span>
</th>
</tr>
<tr *ngFor="let movie of content">
<td>{{movie.id}}</td>
<td>{{movie.title}}</td>
<td>{{movie.rank}}</td>
</tr>
</table>
【问题讨论】:
-
是 sortAsc 和 sortDesc 方法的问题,还是字体图标的问题?将
更改为 如果我删除自定义类它正在工作,但我需要样式你能显示sortAsc和sortDesc的代码吗?sortDesc(col){ console.log(col); }通过编辑添加原问题的所有代码
标签: javascript css angular