【亿码酷站-编程开发教程】收集全网优质教程及源码资源!
全网优质软件开发、平面设计等教程及精品源码资源一站可得,www.ymkuzhan.com!
微信小程序优雅的搜索框
特性
支持自定义热门key
支持搜索历史
支持搜索建议
支持搜索历史(记录)缓存使用
* 引入
// 模版引入
<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);
}
上一页:
下一页:
相关推荐
-
微信小程序优雅的搜索框
2314713
44 -
html植物花卉公司响应式网站模板
2213698
118 -
微信小程序-智能用电系统
2298324
67
【亿码酷站】—网站源码下载—微信小程序优雅的搜索框
床上用品html灰色网站模板
本文永久链接地址:https://www.ymkuzhan.com/2579.html