From d669ab64c02cd558c4379319e5aa72f789e07975 Mon Sep 17 00:00:00 2001 From: hdx Date: Mon, 21 Aug 2023 17:20:44 +0800 Subject: [PATCH] =?UTF-8?q?long-list:=20=E7=AE=80=E5=8C=96=E5=93=8D?= =?UTF-8?q?=E5=BA=94=E6=95=B0=E6=8D=AE=E5=A4=84=E7=90=86=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/template/long-list/long-list.uvue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pages/template/long-list/long-list.uvue b/pages/template/long-list/long-list.uvue index ab347f11..1fc12866 100644 --- a/pages/template/long-list/long-list.uvue +++ b/pages/template/long-list/long-list.uvue @@ -73,14 +73,16 @@ }, dataType: '', success: (res) => { - const responseData = JSON.parse(res.data as string)! - const list = responseData.data + const responseData = JSON.parse(res.data as string) + if (responseData == null) { + return + } - list.forEach((item) => { + responseData.data.forEach((item) => { this.dataList.push(item) }) - this.isEnded = list.length <= 0; + this.isEnded = responseData.data.length <= 0; this.$currentPage++ }, -- GitLab