ionic2 ion-input 设置焦点 focus blur

//html file

//1. import componet
import { ElementRef, ViewChild } from '@angular/core';
//2. statement
export class xxPage {
@ViewChild('forgetSendCodeInput') forgetSendCodeInput;
}
//3. configure config.xml file

//ts file focus
this.forgetSendCodeInput._native.nativeElement.focus();
//ts file blur
this.forgetSendCodeInput._native.nativeElement.focus();

你可能感兴趣的:(ionic2 ion-input 设置焦点 focus blur)