From dcf62f545495ea3fb48395141b22ad78e82b0402 Mon Sep 17 00:00:00 2001 From: xuhuajiao <13476289682@163.com> Date: Mon, 7 Nov 2022 09:41:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B9=A6=E6=9E=B6=E5=B1=82=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/bookRackList.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/views/bookRackList.vue b/src/views/bookRackList.vue index 578b120..aafcbd8 100644 --- a/src/views/bookRackList.vue +++ b/src/views/bookRackList.vue @@ -13,7 +13,7 @@
-
+
@@ -134,9 +134,11 @@ export default { // } // } this.listData.splice(0, this.listData.length, ...res.shelfAll) - for (let index = 0; index < res.shelfs.length; index++) { - const shelfNo = res.shelfs[index] - this.$set(this.bookList, shelfNo, res.shelfBook[shelfNo]) + if (res.shelfs.length !== 0) { + for (let index = 0; index < res.shelfs.length; index++) { + const shelfNo = res.shelfs[index] + this.$set(this.bookList, shelfNo, res.shelfBook[shelfNo]) + } } if (this.listData.length > 0) { this.initSwiper()