From a63b867a5adfc0a261ff8b0ef1f2ee4fb21facc2 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Mon, 21 Nov 2022 14:21:52 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20@=E7=BB=93=E6=9E=9C=E7=9B=B8=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E9=81=BF=E5=85=8D=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/js/pages/manage/components/ChatInput/index.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/assets/js/pages/manage/components/ChatInput/index.vue b/resources/assets/js/pages/manage/components/ChatInput/index.vue index fbce493fe..bbd4ccb64 100755 --- a/resources/assets/js/pages/manage/components/ChatInput/index.vue +++ b/resources/assets/js/pages/manage/components/ChatInput/index.vue @@ -576,6 +576,7 @@ export default { containers[i].classList.add(mentionName); $A.scrollPreventThrough(containers[i]); } + let mentionSourceCache = null; this.getMentionSource(mentionChar, searchTerm, array => { const values = []; array.some(item => { @@ -588,7 +589,10 @@ export default { values.push(...list) } }) - renderList(values, searchTerm); + if ($A.jsonStringify(values.map(({id}) => id)) !== mentionSourceCache) { + mentionSourceCache = $A.jsonStringify(values.map(({id}) => id)) + renderList(values, searchTerm); + } }) } }