• Stars
    star
    532
  • Rank 83,008 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 8 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

wxSearch-微信小程序优雅的搜索框

wxSearch

  • 🔍 微信小程序优雅的搜索框

来源

wxParse信息

开发信息

微信小程序开发论坛 垂直微信小程序开发交流社区

小码消息

特性

  • 支持自定义热门key
  • 支持搜索历史
  • 支持搜索建议
  • 支持搜索历史(记录)缓存

效果

wxSearch效果gif1 wxSearch效果gif2

使用

* 引入

// 模版引入
<import src="/wxSearch/wxSearch.wxml"/>
<template is="wxSearch" data="{{wxSearchData}}"/>
// wxss中引入
@import "/wxSearch/wxSearch.wxss";

* 使用

//wxSearch 暴漏的接口

module.exports = {
    init: init,
    initColor: initColors,
    initMindKeys: initMindKeys,
    wxSearchInput: wxSearchInput,
    wxSearchFocus: wxSearchFocus,
    wxSearchBlur: wxSearchBlur,
    wxSearchKeyTap: wxSearchKeyTap,
    wxSearchAddHisKey:wxSearchAddHisKey,
    wxSearchDeleteKey:wxSearchDeleteKey,
    wxSearchDeleteAll:wxSearchDeleteAll,
    wxSearchHiddenPancel:wxSearchHiddenPancel
}

//初始化
onLoad: function () {
    console.log('onLoad')
    var that = this
    //初始化的时候渲染wxSearchdata 第二个为你的search高度
    WxSearch.init(that,43,['weappdev','小程序','wxParse','wxSearch','wxNotification']);
    WxSearch.initMindKeys(['weappdev.com','微信小程序开发','微信开发','微信小程序']);
},

wxSearchFn: function(e){
    var that = this
    WxSearch.wxSearchAddHisKey(that);
    
  },
  wxSearchInput: function(e){
    var that = this
    WxSearch.wxSearchInput(e,that);
  },
  wxSerchFocus: function(e){
    var that = this
    WxSearch.wxSearchFocus(e,that);
  },
  wxSearchBlur: function(e){
    var that = this
    WxSearch.wxSearchBlur(e,that);
  },
  wxSearchKeyTap:function(e){
    var that = this
    WxSearch.wxSearchKeyTap(e,that);
  },
  wxSearchDeleteKey: function(e){
    var that = this
    WxSearch.wxSearchDeleteKey(e,that);
  },
  wxSearchDeleteAll: function(e){
    var that = this;
    WxSearch.wxSearchDeleteAll(that);
  },
  wxSearchTap: function(e){
    var that = this
    WxSearch.wxSearchHiddenPancel(that);
  }

More Repositories

1

wxParse

wxParse-微信小程序富文本解析自定义组件,支持HTML及markdown解析
JavaScript
7,733
star
2

WxNotificationCenter

WxNotificationCenter - 微信小程序通知广播模式类,降低小程序之间的耦合度
JavaScript
423
star
3

wxflex

微信小程序的Flex布局demo-4种必备常用的Flex布局模式
JavaScript
224
star
4

WxMasonry

WxMasonry-微信小程序瀑布流布局模式
JavaScript
124
star
5

fenda

微信小程序-7天写分答微信小程序
JavaScript
109
star
6

wxSortPickerView

wxSortPickerView-微信小程序首字母排序选择表
JavaScript
86
star
7

WxEmojiView

WxEmojiView
JavaScript
54
star
8

diaoyu

五分钟制作"钓鱼网站"
39
star
9

WxAutoImage

微信小程序中的图片自适应宽高的计算类
JavaScript
34
star
10

DebateTimeDown

辩论赛计时器
JavaScript
12
star
11

one-read

一览的chrome插件版,“one” for chrome extend
JavaScript
7
star
12

icindy.github.io

cindy's blog 开发版
HTML
6
star
13

wxCharts

wxCharts-微信小程序图表开源插件
JavaScript
5
star
14

wxScrollBugDemo

wxScrollBugDemo: 微信小程序中的scroll-view真机下遮挡问题
JavaScript
3
star
15

youdao_words

有道单词的批量导入单词本,文件中仅需要单词即可
HTML
2
star
16

wxDataDemo

wxDataDemo:微信小程序数据操作文章的例子(含:微信小城数据操作处理上:合理组装数据、微信小城数据操作处理下:深度操作数据)
JavaScript
2
star
17

jquery.countdown

jquery countdown plugin. jquery倒计时插件
JavaScript
2
star
18

node-webkit-demo

node-webkit for cindy blog demo
1
star