From 89bed3e0eebce01b8055666f63a09e29751f076a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=87=AA=E5=B8=A6=E5=A4=A7=E4=BD=AC=E6=B0=94=E5=9C=BA?= <188633308@qq.com> Date: Tue, 11 May 2021 10:04:45 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E9=99=8D=E4=BD=8E=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E9=80=9F=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Web/src/views/main/_layout/header/search.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Web/src/views/main/_layout/header/search.js b/Web/src/views/main/_layout/header/search.js index cae9bd6..043f2f8 100644 --- a/Web/src/views/main/_layout/header/search.js +++ b/Web/src/views/main/_layout/header/search.js @@ -10,6 +10,8 @@ export default { return { searchText: '', searchResult: [], + + timer: null }; }, @@ -44,6 +46,14 @@ export default { onSearch(value) { + clearTimeout(this.timer) + + this.timer = setTimeout(() => { + this.doSearch(value) + }, 300) + }, + + doSearch(value) { this.searchText = value const menus = this.$_.concat.apply(this, this.$_.cloneDeep(this.menus.map(p => p.menu)))