下面的代码用于在点击 ion-item 时打开模式
<ion-item lines="none" (click)="selectDepartment()" class="m-0 ion-float-left w100">
<ion-input formControlName="department_name" ngDefaultControl readonly type="text" placeholder="Select Department" class="tenx-input with-icon header-sub-head-font-16 w100 ion-float-left">
<ion-icon class="header-sub-head-font-16" src="assets/icon/down-arrow.svg" item-right></ion-icon>
</ion-input>
</ion-item>
只有当用户第二次点击 ion-item 时才会触发“selectDepartment”。尝试了许多解决方案但没有运气
离子信息
Ionic:
Ionic CLI : 5.4.16 (C:\Users\Nitin\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 5.3.4
@angular-devkit/build-angular : 0.1000.8
@angular-devkit/schematics : 10.0.8
@angular/cli : 10.0.8
@ionic/angular-toolkit : 2.3.3
Cordova:
Cordova CLI : 10.0.0
Cordova Platforms : android 9.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 12 other plugins)
Utility:
cordova-res : 0.12.1
native-run : 1.0.0
System:
Android SDK Tools : 26.1.1 (C:\Android\sdk)
NodeJS : v10.17.0 (C:\Program Files\nodejs\node.exe)
npm : 6.11.3
OS : Windows 10