From 2ca0a443881b3992dc455f51b8ac38f8ee7bb86f Mon Sep 17 00:00:00 2001 From: z_yu <1534695664@qq.com> Date: Wed, 28 Sep 2022 14:54:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E6=9E=B6=E5=9B=BE=E4=B9=A6=E9=BB=98?= =?UTF-8?q?=E8=AE=A45=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/bookRackList.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/views/bookRackList.vue b/src/views/bookRackList.vue index cfad01d..7cee300 100644 --- a/src/views/bookRackList.vue +++ b/src/views/bookRackList.vue @@ -62,7 +62,6 @@ export default { initSwiper() { this.$nextTick(() => { for (const key in this.bookList) { - console.log(key) this.bookList[key].forEach((el, index) => { new Swiper('.swiper' + index, { slidesPerView: 'auto', @@ -114,6 +113,14 @@ export default { params.shelfNo = this.$route.query.rightShelfNo } initBookshelfDetails(params).then((res) => { + console.log(this.listData) + if (res.shelfs.length === 0) { + res.shelfs.push('firstShelf', 'secondShelf', 'thirdShelf', 'fourthShelf', 'fivethShelf') + for (let index = 0; index < res.shelfs.length; index++) { + const shelfNo = res.shelfs[index] + res.shelfBook[shelfNo] = [] + } + } this.listData.splice(0, this.listData.length, ...res.shelfs) for (let index = 0; index < res.shelfs.length; index++) { const shelfNo = res.shelfs[index]