模糊搜索
获取搜索框的内容,注意节流防抖
// 模糊查询
db.collection('publish').where({
name:db.RegExp({
regexp:e.detail.value.trim(),//搜索框内容
options:'i'//大小写不区分
})
}).get({
success:res=>{
// console.log(res)
const {data}=res
this.setData({
searchList:data
})
}
})
https://blog.csdn.net/sjp991012/article/details/123406469