根据此链接 https://ionicframework.com/docs/api/input#events ionic 支持 按键 事件,该事件在浏览器中运行良好,但在移动设备中未触发
网页格式
<ion-item>
<ion-label>Default Label</ion-label>
<ion-input (keypress)="test($event)"></ion-input>
</ion-item>
TS
test(event){
console.log(event);
e.preventDefault();
}
上面的代码在 ionic serve 中工作正常,在移动设备中不工作
根据这个 https://developer.mozilla.org/en-US/docs/Web/API/Document/keypress_event keypress is depricated 我不明白
我尝试过的事件:按键、按键、按键、离子模糊、离子变化、输入等。
原文由 Mohan Gopi 发布,翻译遵循 CC BY-SA 4.0 许可协议
根据您自己的第一个链接,我猜您正在寻找事件
ionInput Emitted when a keyboard input ocurred.
: