We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 24fa1c8 commit 726e476Copy full SHA for 726e476
1 file changed
miniprogram/pages/search/index.js
@@ -32,11 +32,6 @@ Page({
32
},
33
34
handleSearch({ detail }) {
35
- if (detail.value == '') {
36
- this.setData({ result: [] })
37
- return
38
- };
39
-
40
this.setData({ isLoading: true })
41
if (this.lastTrigger) {
42
clearTimeout(this.lastTrigger)
@@ -47,6 +42,13 @@ Page({
47
48
43
49
44
doSearch(keyword) {
45
+ if (keyword == '') {
46
+ this.setData({
+ result: [],
+ isLoading: false
+ })
50
+ return
51
+ };
52
const fuzzySearch = (key) => {
53
if (typeof key == 'string') return key.indexOf(keyword) > -1
54
if (Array.isArray(key)) {
0 commit comments