如何处理“Go"/“Enter"键盘按钮 Ionic2 <离子输入> [英] How to handle &quot;Go&quot;/&quot;Enter&quot; keyboard button Ionic2 &lt;ion-input&gt;

查看:29
本文介绍了如何处理“Go"/“Enter"键盘按钮 Ionic2 <离子输入>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

处理输入上的enter"或go"键盘键的事件是什么?输入不在表单中使用.所以点击它不会提交".我只需要这个活动.

What is the event to handle "enter" or "go" keyboard key on an input? The input is not used within a form. So clicking on it will not "submit". I just need the event.

(在 Beta 11 上运行 android + Ionic 2)

(Running android + Ionic 2 on Beta 11)

推荐答案

我是这样做的:

<ion-input type="text" [(ngModel)]="username" (keyup.enter)="handleLogin()"></ion-input>

还有:

handleLogin() {
    // Do your stuff here
}

这篇关于如何处理“Go"/“Enter"键盘按钮 Ionic2 <离子输入>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆