代码之家  ›  专栏  ›  技术社区  ›  Ronan Lopes

离子2-键盘操作:输入而不是前进

  •  0
  • Ronan Lopes  · 技术社区  · 8 年前

    我在爱奥尼亚2上有一个登录表单,视图如下:

     <form #f="ngForm" (ngSubmit)="login(f)">
            <ion-list>
              <ion-item>
                <ion-label floating>E-mail</ion-label>
                <ion-input
                  type="email"
                  ngModel
                  name="email"
                  required></ion-input>
              </ion-item>
              <ion-item>
                <ion-label floating>Password</ion-label>
                <ion-input
                  type="password"
                  ngModel
                  name="password"
                  required></ion-input>
              </ion-item>
            </ion-list>
            <br>
            <button ion-button block type="submit" [disabled]="!f.valid">Enter</button>
            <br>
            <h2 class="text-center"><a (click)="forgotPassword()">Forgot your password? </a></h2>
    
          </form>
    

    编辑:

    澄清一下,这是我的登录屏幕。右下角的按钮“Avan§ar”(advance)就是我想要的“Enter”(提交表单)

    enter image description here

    1 回复  |  直到 8 年前
        1
  •  0
  •   Mystery    8 年前

    对于离子3(因为离子3被标记),您可以使用

    例子

    <ion-input type="password" (keyup.enter)="submit()" required> </ion-input>