相关疑难解决方法(0)

离子2离子选择 - 以编程方式关闭选择框

我正在研究ionic2项目.我使用离子选择元素.

我搜索了一种方法,以编程方式关闭选择框选择任何项目(而不是等待用户按OK).

  <ion-select id="select" #select>
      <ion-option (ionSelect)="closeAndSave()" *ngFor="let option of enumList" [value]="option">{{ option}}</ion-option>
    </ion-select>
Run Code Online (Sandbox Code Playgroud)

`

class myClass{
    @viewChild('select') select:Select;
    closeAndSave(){
        /*it is come here on press any option. but how can I close here my select element? I tried: this.select.destroy()  - not do any thing. any solution?*/
    }
Run Code Online (Sandbox Code Playgroud)

`

ionic2

3
推荐指数
1
解决办法
2296
查看次数

标签 统计

ionic2 ×1