gpt4 book ai didi

angular - md-list-icon 或 md-button 右对齐? (棱 Angular Material 2)

转载 作者:太空狗 更新时间:2023-10-29 17:01:02 28 4
gpt4 key购买 nike

如何使按钮/图标/复选框像 Material 1 中那样右对齐:

Angular Material 1 list with actions https://material.angularjs.org/latest/demo/list

我目前( Material 2)有:

<md-list>
<md-list-item *ngFor="let position of cart">
<h3 md-line> {{ position.name }} </h3>
<p md-line>
<span> Line 1 </span>
</p>
<md-icon md-list-icon>delete</md-icon>
</md-list-item>
</md-list>

Angular Material 2 list with actions

最佳答案

对于上述内容,解决方案非常简单,只需在您的选择器中省略 mat-list-icon,Material 就会发挥作用:

<mat-list>
<mat-list-item *ngFor="let position of cart">
<h3 mat-line> {{ position.name }} </h3>
<p mat-line>
<span> Line 1 </span>
</p>
<div> $2.00 </div>
<button mat-icon-button (click)="remove(1)">
<mat-icon class="mat-24">delete</mat-icon>
</button>
</mat-list-item>
</mat-list>

enter image description here

关于angular - md-list-icon 或 md-button 右对齐? (棱 Angular Material 2),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43761644/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com