angular – On IONIC Ion-Select正在“选择”所有选项
发布时间:2020-12-17 17:03:51 所属栏目:安全 来源:网络整理
导读:在我的Ionic应用程序中,我有一个离子选择: ion-item ion-labelType/ion-label ion-select [(ngModel)]="type" interface="action-sheet" ion-option *ngFor="let type of types" value="type.class" {{type.name}} /ion-option /ion-select/ion-item 每当我
在我的Ionic应用程序中,我有一个离子选择:
<ion-item> <ion-label>Type</ion-label> <ion-select [(ngModel)]="type" interface="action-sheet"> <ion-option *ngFor="let type of types" value="type.class"> {{type.name}} </ion-option> </ion-select> </ion-item> 每当我选择一个选项时,它会选择所有可用的选项. 额外细节:
有帮助吗? 解决方法
由于您的值赋值是动态的,您需要在值周围使用[],
<ion-option *ngFor="let type of types" [value]="type.class"> {{type.name}} </ion-option> 希望能帮助到你. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |