【发布时间】:2021-10-21 23:08:36
【问题描述】:
我想知道为 ion-checkbox 设置自定义值的最佳方法。enter image description here
我已经尝试过了,但它不起作用。
【问题讨论】:
-
阅读:How to Ask
标签: angular ionic-framework checkbox ngmodel
我想知道为 ion-checkbox 设置自定义值的最佳方法。enter image description here
我已经尝试过了,但它不起作用。
【问题讨论】:
标签: angular ionic-framework checkbox ngmodel
试试这样的:
<ion-list>
<ion-item-group lines="inset" *ngFor="let section of item.value">
<ion-item-divider class="bg-light">
<ion-label>{{section.sectionName}}</ion-label>
</ion-item-divider>
<ion-item *ngFor="let menu of section.menuItems">
<ion-label
><strong *ngIf="menu.quantity">({{menu.quantity}})</strong>
{{menu.name}}
<strong>+ $ {{menu.price | number:'1.2-2'}}</strong></ion-label
>
<ion-checkbox
slot="end"
(ionChange)="checkBoxChange($event, menu.menuItemId, menu.name)"
[(ngModel)]="menu.checked"
></ion-checkbox>
</ion-item>
</ion-item-group>
</ion-list>
【讨论】: