美文网首页Ionic
ionic3之ion-select 有选择项的下拉框

ionic3之ion-select 有选择项的下拉框

作者: 云小诺 | 来源:发表于2018-09-13 17:23 被阅读0次

类似于这种:


image.png
<ion-select  selectedText="{{seclectedCountry}}" >
   <ion-option *ngFor="let num of country" (ionSelect)="selectNumber(num)" value={{num.value}}>{{num.title}}   {{num.value}}</ion-option>
</ion-select>



selectNumber(num) {
   this.seclectedCountry = num.value;
}

重点就是这个 selectedText属性,放入要显示出来的值即可。

相关文章

网友评论

    本文标题:ionic3之ion-select 有选择项的下拉框

    本文链接:https://www.haomeiwen.com/subject/dbqggftx.html