html
(1、input type='search' 2、将input套在一个带action的form中 )
<form action=""> <ion-input type="search" placeholder="请输入搜索关键字" (keypress)='test($event)'></ion-input> </form>
typescript
(监听input的keypress事件)
test(event) { if (event && event.keyCode == 13) { alert('yes'); } }
补充:关闭input自动完成
autocomplete='off'
<form action=""> <input autocomplete='off' class="usIndexsch" type="search" name='key' placeholder="目的地/关键词" [(ngModel)]='key' (keypress)='keySelect($event)'> </form>