当前位置:网站首页>Wechat applet association search
Wechat applet association search
2022-06-27 18:23:00 【When you're lonely, the dog stays with you】
wxml
<view style="width: 100%;height: 100rpx; background-color: green;display: flex;justify-content:center;align-items: center;">
<input type="text" placeholder=" Search for " bindinput="search" style="width: 560rpx;height:60rpx;background-color:white;"/>
</view>
<view>
<block wx:for="{
{list}}" wx:key="key">
<view>
{
{item}}
</view>
</block>
</view>
js
// pages/search/search.js
Page({
/**
* Initial data of the page
*/
data: {
arr:['iphone11','iphone12','iphone13','indao'],
list:[],
timer:null,
},
search(res){
clearTimeout(this.data.timer);
this.data.timer = setTimeout(()=>{
let value = res.detail.value;
if(value=='')
{
this.setData({list:[]})
}
let search = this.data.arr;
let reg = new RegExp(value,'i')
let list = [];
list = search.filter((item,key)=>{
return reg.test(item)
})
this.setData({list:list})
console.log(list)
},800)
},
})
边栏推荐
- Wanzhou gold industry: what are the differences between gold t+d investment and other investments?
- 如何制作登录界面
- Kubernetes basic self-study series | introduction to ingress API
- Use pyinstaller to package py files into exe. Precautions and error typeerror:_ get_ sysconfigdata_ name() missing 1...‘ check_ Solutions to exists'
- wheel ui
- leetcode 19. Delete the penultimate node of the linked list
- Introduction to photoswape
- New products, new personnel and new services, Infiniti will continue to plough into China's future!
- Unity shadow shadow pancaking
- Simulated process scheduling
猜你喜欢
d3dx9_ 39.dll how to repair -d3dx9_ 39.dll missing file download
Overview of Inspur Yunxi database executor
d3dx9_ How to repair 38.dll? d3dx9_ 38. How to download a missing DLL?
2022 Liaoning latest fire facility operator simulation test question bank and answers
d3dx9_ How to repair 40.dll? Win10 system d3dx9_ What if 40.dll is lost?
leetcode 70. climb stairs
d3dx9_ How to repair 33.dll? d3dx9_ What if 33.dll is lost?
[the way of programmer training] - 3 Character count statistics
新产品新人事新服务,英菲尼迪继续深耕中国未来可期!
Oracle concept II
随机推荐
leetcode 69. Square root of X
[UVM foundation] UVM_ Is in agent_ Active variable definition
Simulated process scheduling
Part 32 supplement (32) string of ECMAScript
[leetcode] 2. Add two numbers (user-defined listnode), medium
简历如何去写?
Use pyinstaller to package py files into exe. Precautions and error typeerror:_ get_ sysconfigdata_ name() missing 1...‘ check_ Solutions to exists'
Oracle concept II
seata性能可以通过什么方式提高?比如增加数据库的计算节点?
Wanzhou gold industry: what are the differences between gold t+d investment and other investments?
Teach you to use elastic search: run the first hello world search command
Byte + Google super full kotlin learning King fried notes! Kotlin introductory tutorial + Advanced kotlin enhanced actual combat (with demo)
d3dx9_ How to repair 33.dll? d3dx9_ What if 33.dll is lost?
软件测试学习-黑马程序员,软件测试学习大纲
Shardingsphere sharding proxy actual combat scenario
About redis master-slave replication
Oracle TRUNC function processing date format
Written in eclipse, problems after querying the database connection
Teach you how to realize pynq-z2 bar code recognition
leetcode 70. climb stairs