我想在选择离子时显示一个国家标志和名称。该图像未显示在选项中。
该怎么办?
仅此图像而不是国家/地区代码:
。html
<ion-list >
<ion-item>
<ion-label>Choose Country</ion-label>
<ion-select placeholder="Country" value="1" #countryList (ionChange)="chooseCountry()" [(ngModel)]="userCountry">
<ion-select-option *ngFor="let item of optionsArray" value="{{item.id}}">
{{item.name}}
<img class="flag" [src]='item.flag'>
</ion-select-option>
</ion-select>
</ion-item>
</ion-list>
不可能在ion-select-option中添加图像,但是您可以通过::自己实现相同的操作:>
有关更多信息,请写评论,并随时与您在一起。