From 174e0ae74333f4a742cb76e50bb3bd0b2a41ea80 Mon Sep 17 00:00:00 2001 From: purocean Date: Mon, 5 Aug 2019 17:24:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=90=9C=E7=B4=A2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/QuickOpen.vue | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/QuickOpen.vue b/frontend/src/components/QuickOpen.vue index ec0c3170..73790f54 100644 --- a/frontend/src/components/QuickOpen.vue +++ b/frontend/src/components/QuickOpen.vue @@ -46,16 +46,15 @@ export default { } }, created () { - this.searchWithDebounce = _.debounce((text, call) => { + this.searchWithDebounce = _.debounce(async (text, call) => { if (this.repo && text.trim()) { const fetchTime = new Date().getTime() this.lastFetchTime = fetchTime - file.search(this.repo, text.trim(), data => { - // 总是保证最后的搜索结果出现在列表 - if (fetchTime >= this.lastFetchTime) { - call(data) - } - }) + const data = await file.search(this.repo, text.trim()) + // 总是保证最后的搜索结果出现在列表 + if (fetchTime >= this.lastFetchTime) { + call(data) + } } else { this.list = [] }