我尝试使用@each
sass函数,但是我总是收到错误Unterminated attribute selector for track
。我不知道我的代码在哪里。
HTML
<ion-list>
<ion-item-sliding [attr.track]="green" >
<ion-item>
Item
</ion-item>
<ion-item-options side="left">
<button ion-button (click)="favorite(item)">Favorite</button>
<button ion-button color="danger" (click)="share(item)">Share</button>
</ion-item-options>
<ion-item-options side="right">
<button ion-button (click)="unread(item)">Unread</button>
</ion-item-options>
</ion-item-sliding>
</ion-list>
SASS CSS密码
@each $track, $value in auxiliary-categories() {
ion-item-sliding [track=#{$track}] ion-label {
border-left: 5px solid $value;
padding-left: 10px;
}
}
$categories: (
ionic: color($colors, primary),
angular: #AC282B,
communication: #8E8D93,
red: #FE4C52,
yellow: #FED035,
green: #69BB7B,
blau: #3BC7C4,
);
@function auxiliary-categories() {
@return map-remove($categories);
}