使用JS轻松实现ionic调用键盘搜索功能(超实用)

作者:mrr 时间:2024-04-17 10:26:21 

这个需求是产品提的,一开始只是设置了 <input style="padding-top: 3px;" type="search" placeholder="搜索医生或医院" ng-model="query">

type="search"

发现android上可以ios调取不出search健来,气死我了,经过google的搜索得到结论,需要在外面套用一个form表单,于是加上果然好使而且结合了form表单提交的事件直接调用了button 按钮的点击事件ng-click="searchSelect()",不需要额外再去监听搜索键盘点击事件,省了一大堆的麻烦,果然很实用啊,我真是个天才

hml代码如下:


<form>
<div class="bar bar-header item-input-inset" style="height: 50px;">
<label class="item-input-wrapper" id="search-input">
<i class="icon ion-ios-search" style="position: relative;color: gray;font-size: 1.5em;top: 1px;"></i>
<input style="padding-top: 3px;" type="search" placeholder="搜索医生或医院" ng-model="query">
</label>
<button class="button button-clear" style="color: #49B746;" ng-click="searchSelect()">搜索</button>
</div>
</form>

js代码如下:


$scope.searchSelect = function(){
if ($scope.currentSearchType == 'hospital'){
}else{
$scope.search();
}
};

以上所述是小编给大家介绍的使用JS轻松实现ionic调用键盘搜索功能(超实用)网站的支持!

标签:ionic,键盘,搜索
0
投稿

猜你喜欢

  • Go快速开发一个RESTful API服务

    2024-04-30 10:05:07
  • python网络编程学习笔记(三):socket网络服务器

    2023-01-11 10:40:29
  • python生成随机数、随机字符、随机字符串的方法示例

    2021-06-04 06:46:39
  • SQL Server 创建约束图解(唯一 主键)

    2024-01-26 08:20:37
  • spring boot整合mybatis使用c3p0数据源连接mysql

    2024-01-25 08:13:15
  • javascript异步处理工作机制详解

    2024-04-10 13:58:36
  • python区块链创建多个交易教程

    2021-05-28 13:40:42
  • vue3中路由传参query、params及动态路由传参详解

    2023-07-02 16:58:29
  • Navicat连接MySQL错误描述分析

    2024-01-17 13:39:31
  • django admin后管定制-显示字段的实例

    2023-07-01 11:34:18
  • Python3.8 + Tkinter: Button设置image属性不显示的问题及解决方法

    2021-08-12 00:40:33
  • pandas进行数据的交集与并集方式的数据合并方法

    2022-05-16 08:48:08
  • MYSQL教程:查询优化之有效加载数据

    2009-02-27 15:45:00
  • Python实现计算文件MD5和SHA1的方法示例

    2023-12-07 06:55:46
  • python记录程序运行时间的三种方法

    2023-08-25 03:12:19
  • Oracle 随机数

    2009-06-04 10:01:00
  • 简单了解python的内存管理机制

    2021-10-03 18:13:11
  • python 直接赋值和copy的区别详解

    2023-12-14 04:08:49
  • Python3如何使用多线程升程序运行速度

    2023-02-06 05:11:42
  • VsCode搭建Go语言开发环境的配置教程

    2024-05-11 09:09:02
  • asp之家 网络编程 m.aspxhome.com