美文网首页
Ionic2开发笔记——监听手机软键盘搜索键

Ionic2开发笔记——监听手机软键盘搜索键

作者: 面向秋名山编程 | 来源:发表于2017-05-08 15:07 被阅读0次

    遇到这个问题,说明对ionic2比较熟悉了,这些属性就不过多解释,直接上代码。

    HTML页面代码

    <!--action会刷新页面-->

    <form class="form">

    <ion-input type = "search" autocomplete="off" placeholder="搜索" [(ngModel)]="searchs" name="search">

    <button (click)="search(searchs)" style="visibility:hidden;">

    </form>

    SCSS代码:

    .form{

    width: 100%;

    display: flex;

    justify-content: space-between;

    align-items: center;

    }

    TS部分代码:

    searchs:string;

    search(){

    alert("你点击了软键盘搜索键搜索"+this.searchs);

    }

    相关文章

      网友评论

          本文标题:Ionic2开发笔记——监听手机软键盘搜索键

          本文链接:https://www.haomeiwen.com/subject/pkwmtxtx.html