在Spartacus _list.scss里有这样的mixin定义:
is-current-active-selection:
定义在organization unit list行项目的a标签的class:is-current上
运行时效果:
换一种颜色:
什么时候给这个tr标签分配的is-current class?
<tr
*ngFor="let item of data; trackBy: trackData"
[class.is-current]="isCurrentItem(item)"
(click)="launchItem(item)"
>
下面这段代码给tr标签赋上is-current的class:
最后在platform-browser.js里调用浏览器原生的html元素的classList属性的add方法,添加新的is-current类:
更多Jerry的原创文章,尽在:"汪子熙":
网友评论