From d4f2efd5152849eeb71c1f89d24d785c71518498 Mon Sep 17 00:00:00 2001 From: a0049873 <79py69t9wb@privaterelay.appleid.com> Date: Fri, 5 Aug 2022 14:50:38 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/workBench/components/frequency-top5-view.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/back/src/views/modules/workBench/components/frequency-top5-view.vue b/back/src/views/modules/workBench/components/frequency-top5-view.vue index 199bcbb8..b1594f0c 100644 --- a/back/src/views/modules/workBench/components/frequency-top5-view.vue +++ b/back/src/views/modules/workBench/components/frequency-top5-view.vue @@ -87,7 +87,13 @@ export default { this.noData = true return } - for (let i = 0; i < 3; i++) { + let num = 0 + if (_arr.length < 3) { + num = _arr.length + } else { + num = 3 + } + for (let i = 0; i < num; i++) { const k = i + 1 this[`no${k}Obj`].name = _arr[i].name this[`no${k}Obj`].count = _arr[i].count